From 531e600abb6c40a89ea2b01a8b318a76a4061e3a Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 1 Mar 2019 12:16:15 -0700 Subject: [PATCH] Add user:show command --- app/Console/Commands/UserShow.php | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 app/Console/Commands/UserShow.php diff --git a/app/Console/Commands/UserShow.php b/app/Console/Commands/UserShow.php new file mode 100644 index 00000000..d72bf823 --- /dev/null +++ b/app/Console/Commands/UserShow.php @@ -0,0 +1,54 @@ +argument('id'); + $user = User::whereUsername($id)->orWhere('id', $id)->first(); + if(!$user) { + $this->error('Could not find any user with that username or id.'); + exit; + } + + $this->info('User ID: ' . $user->id); + $this->info('Username: ' . $user->username); + $this->info('Email: ' . $user->email); + $this->info('Joined: ' . $user->created_at->diffForHumans()); + $this->info('Status Count: ' . $user->statuses()->count()); + } +}