|
|
|
@ -2,27 +2,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
namespace Database\Seeders;
|
|
|
|
namespace Database\Seeders;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use Carbon\Carbon;
|
|
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
|
|
use App\Models\Role;
|
|
|
|
use App\Models\Role;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
|
|
|
|
|
|
class RoleSeeder extends Seeder {
|
|
|
|
class RoleSeeder extends Seeder
|
|
|
|
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Run the database seeds.
|
|
|
|
* Run the database seeds.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function run() {
|
|
|
|
public function run()
|
|
|
|
|
|
|
|
{
|
|
|
|
DB::table('roles')->truncate();
|
|
|
|
DB::table('roles')->truncate();
|
|
|
|
Role::insert(
|
|
|
|
Role::insert(
|
|
|
|
[
|
|
|
|
[
|
|
|
|
['name' => 'Administrator', 'slug' => 'admin'],
|
|
|
|
['name' => 'Administrator', 'slug' => 'admin', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()],
|
|
|
|
['name' => 'User', 'slug' => 'user'],
|
|
|
|
['name' => 'User', 'slug' => 'user', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()],
|
|
|
|
['name' => 'Customer', 'slug' => 'customer'],
|
|
|
|
['name' => 'Customer', 'slug' => 'customer', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()],
|
|
|
|
['name' => 'Editor', 'slug' => 'editor'],
|
|
|
|
['name' => 'Editor', 'slug' => 'editor', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()],
|
|
|
|
['name' => 'All', 'slug' => '*'],
|
|
|
|
['name' => 'All', 'slug' => '*', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()],
|
|
|
|
['name' => 'Super Admin', 'slug' => 'super-admin'],
|
|
|
|
['name' => 'Super Admin', 'slug' => 'super-admin', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()],
|
|
|
|
]
|
|
|
|
]
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|