-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added Admin factory for the seeding
* php artisan make:factory Admin
- Loading branch information
ahmadhuss
committed
May 10, 2021
1 parent
1913553
commit 28c11e9
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Database\Factories; | ||
|
||
use App\Models\Admin; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
use Illuminate\Support\Facades\Hash; | ||
use Illuminate\Support\Str; | ||
|
||
class AdminFactory extends Factory | ||
{ | ||
/** | ||
* The name of the factory's corresponding model. | ||
* | ||
* @var string | ||
*/ | ||
protected $model = Admin::class; | ||
|
||
/** | ||
* Define the model's default state. | ||
* | ||
* @return array | ||
*/ | ||
public function definition() | ||
{ | ||
return [ | ||
'name' => 'Admin', | ||
'email' => 'admin@admin.com', | ||
'email_verified_at' => now(), | ||
'password' => Hash::make('password'), | ||
'remember_token' => Str::random(10), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters