Bristol SU Support Package
HandlesAuthentication.php
Go to the documentation of this file.
1 <?php
2 
4 
10 
15 {
16 
23  public function newUser($attributes = [])
24  {
25  return factory(\BristolSU\ControlDB\Models\User::class)->create($attributes);
26  }
27 
34  public function newGroup($attributes = [])
35  {
36  return factory(\BristolSU\ControlDB\Models\Group::class)->create($attributes);
37  }
38 
45  public function newRole($attributes = [])
46  {
47  return factory(\BristolSU\ControlDB\Models\Role::class)->create($attributes);
48  }
49 
57  public function beGroup(Group $group)
58  {
59  app()->make(Authentication::class)->setGroup($group);
60  }
61 
69  public function beRole(Role $role)
70  {
71  app()->make(Authentication::class)->setRole($role);
72  }
73 
74 
82  public function beUser(User $user)
83  {
84  app()->make(Authentication::class)->setUser($user);
85  }
86 
87 }