34 lines
551 B
PHP
34 lines
551 B
PHP
|
<?php
|
||
|
|
||
|
namespace Database\Seeders;
|
||
|
|
||
|
use Illuminate\Database\Seeder;
|
||
|
use Spatie\Permission\Models\Role;
|
||
|
|
||
|
class RolesSeeder extends Seeder
|
||
|
{
|
||
|
/**
|
||
|
* Run the database seeds.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function run()
|
||
|
{
|
||
|
$data = $this->data();
|
||
|
|
||
|
foreach ($data as $value) {
|
||
|
Role::create([
|
||
|
'name' => $value['name'],
|
||
|
]);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public function data()
|
||
|
{
|
||
|
return [
|
||
|
['name' => 'admin'],
|
||
|
['name' => 'editor'],
|
||
|
];
|
||
|
}
|
||
|
}
|