for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Console\Commands\Traits;
use App\User;
/**
* Trait AsksForUsers.
*/
trait AsksForUsers
{
* Ask for events.
*
* @return mixed
public function askForUsers()
$users = User::all();
$user_names = $users->pluck('name')->toArray();
$user_name = $this->choice('User?', $user_names);
choice()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
/** @scrutinizer ignore-call */
return $users->where('name', $user_name)->first()->id;
}