You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
656 B
29 lines
656 B
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use TCG\Voyager\Models\Role;
|
|
|
|
class RolesTableSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Auto generated seed file.
|
|
*/
|
|
public function run()
|
|
{
|
|
$role = Role::firstOrNew(['name' => 'admin']);
|
|
if (!$role->exists) {
|
|
$role->fill([
|
|
'display_name' => __('voyager::seeders.roles.admin'),
|
|
])->save();
|
|
}
|
|
|
|
$role = Role::firstOrNew(['name' => 'user']);
|
|
if (!$role->exists) {
|
|
$role->fill([
|
|
'display_name' => __('voyager::seeders.roles.user'),
|
|
])->save();
|
|
}
|
|
}
|
|
}
|
|
|