-
-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #532 from Kovah/dev
Release
- Loading branch information
Showing
12 changed files
with
396 additions
and
438 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands; | ||
|
||
use App\Models\User; | ||
use Illuminate\Console\Command; | ||
|
||
class ListUsersCommand extends Command | ||
{ | ||
protected $signature = 'users:list'; | ||
|
||
protected $description = 'List all active users with user name and email'; | ||
|
||
public function handle(): void | ||
{ | ||
$this->info('Searching for all registered users...'); | ||
|
||
$users = User::query()->get(['id', 'name', 'email']); | ||
|
||
if ($users->isEmpty()) { | ||
$this->info('No users found.'); | ||
return; | ||
} | ||
|
||
$this->table(['ID', 'Name', 'Email'], $users->toArray()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.