for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Containers\Authorization\Tasks;
use App\Containers\User\Models\User;
use App\Port\Task\Abstracts\Task;
/**
* Class AssignUserToRoleTask.
*
* @author Mahmoud Zalt <[email protected]>
*/
class AssignUserToRoleTask extends Task
{
* @param \App\Containers\User\Models\User $user
* @param array $roles
* @return \App\Containers\User\Models\User
public function run(User $user, array $roles)
$user = $user->assignRole($roles);
return $user;
}