thinkstudeo /
laravel-rakshak
| 1 | <?php |
||||
| 2 | |||||
| 3 | use Faker\Generator as Faker; |
||||
| 4 | |||||
| 5 | $factory->define(config('auth.providers.users.model'), function (Faker $faker) { |
||||
| 6 | $name = $faker->name; |
||||
| 7 | |||||
| 8 | return [ |
||||
| 9 | 'name' => $name, |
||||
| 10 | 'username' => strtolower(str_replace(' ', '', $name)), |
||||
| 11 | 'email' => $faker->unique()->safeEmail, |
||||
| 12 | 'mobile' => $faker->e164PhoneNumber, |
||||
| 13 | 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret |
||||
| 14 | 'remember_token' => str_random(10), |
||||
|
0 ignored issues
–
show
|
|||||
| 15 | 'status' => 'active', |
||||
| 16 | ]; |
||||
| 17 | }); |
||||
| 18 | |||||
| 19 | $factory->state(config('auth.providers.users.model'), 'HrManager', ['name' => 'H R Manager']) |
||||
| 20 | ->afterCreatingState(config('auth.providers.users.model'), 'HrManager', function ($user, $faker) { |
||||
|
0 ignored issues
–
show
The parameter
$faker is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||
| 21 | $manageUsers = create(\Thinkstudeo\Rakshak\Ability::class, ['name' => 'manage_users']); |
||||
| 22 | |||||
| 23 | $hrManager = create(\Thinkstudeo\Rakshak\Role::class, ['name' => 'hr_manager'])->addAbility($manageUsers); |
||||
|
0 ignored issues
–
show
The method
addAbility() does not exist on Illuminate\Database\Eloquent\Factory.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||||
| 24 | // dd($manageUsers->roles); |
||||
| 25 | $user->assignRole($hrManager); |
||||
| 26 | }); |
||||
| 27 | |||||
| 28 | $factory->state(config('auth.providers.users.model'), 'ContentManager', ['name' => 'Content Manager']) |
||||
| 29 | ->afterCreatingState(config('auth.providers.users.model'), 'ContentManager', function ($user, $faker) { |
||||
|
0 ignored issues
–
show
The parameter
$faker is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||
| 30 | $manageContent = create(\Thinkstudeo\Rakshak\Ability::class, ['name' => 'manage_content']); |
||||
| 31 | |||||
| 32 | $hrManager = create(\Thinkstudeo\Rakshak\Role::class, ['name' => 'content_manager'])->addAbility($manageContent); |
||||
| 33 | // dd($manageUsers->roles); |
||||
| 34 | $user->assignRole($hrManager); |
||||
| 35 | }); |
||||
| 36 | |||||
| 37 | // $factory->state(config('auth.providers.users.model'), 'SuperUser', ['name' => 'Super User']) |
||||
| 38 | // ->afterCreatingState(config('auth.providers.users.model'), 'SuperUser', function ($user, $faker) { |
||||
| 39 | |||||
| 40 | // $superUser = create(\Thinkstudeo\Rakshak\Role::class, ['name' => 'super']); |
||||
| 41 | // // dd($manageUsers->roles); |
||||
| 42 | // $user->assignRole($superUser); |
||||
| 43 | // }); |
||||
| 44 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.