mirror of
https://github.com/10h30/Test-Laravel-Eloquent-Basics.git
synced 2026-06-05 15:07:45 +09:00
Task 10 - scopes
This commit is contained in:
@@ -55,4 +55,14 @@ class UserController extends Controller
|
||||
|
||||
return redirect('/')->with('success', 'Users deleted');
|
||||
}
|
||||
|
||||
public function only_active()
|
||||
{
|
||||
// TASK: That "active()" doesn't exist at the moment.
|
||||
// Create this scope to filter "where email_verified_at is not null"
|
||||
$users = User::active()->get();
|
||||
|
||||
return view('users.index', compact('users'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user