Refactor broadcast notifications (#1402)
* Refactor broadcast notifications * StyleCI fixes * Fix the planned_distance accidental changes
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Models\Pirep;
|
||||
use App\Models\Role;
|
||||
use App\Models\Subfleet;
|
||||
use App\Models\User;
|
||||
use App\Services\UserService;
|
||||
use Exception;
|
||||
|
||||
trait TestData
|
||||
@@ -32,6 +33,25 @@ trait TestData
|
||||
], $attrs));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an admin user
|
||||
*
|
||||
* @param array $attrs
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function createAdminUser(array $attrs = []): User
|
||||
{
|
||||
/** @var User $admin */
|
||||
$admin = factory(User::class)->create($attrs);
|
||||
|
||||
/** @var UserService $userSvc */
|
||||
$userSvc = app(UserService::class);
|
||||
$userSvc->addUserToRole($admin, 'admin');
|
||||
|
||||
return $admin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new PIREP with a proper subfleet/rank/user and an
|
||||
* aircraft that the user is allowed to fly
|
||||
|
||||
Reference in New Issue
Block a user