Add migrations and seeders support
This commit is contained in:
23
database/seeders/AddTestRight.php
Normal file
23
database/seeders/AddTestRight.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Component\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class AddTestRight extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
if(\App\Models\Right::where('code', 'test')->count() == 0) {
|
||||
$right = new \App\Models\Right();
|
||||
$right->code = 'test';
|
||||
$right->name = 'Тестовый раздел';
|
||||
$right->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user