File: /var/www/vhost/disk-apps/demo.sports-crowd.com/database/seeds/AddErpLogsModuleSeeder.php
<?php
use App\Module;
use Illuminate\Database\Seeder;
class AddErpLogsModuleSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$parent = Module::where('route', 'logs')->first();
// Log ERP
if (!Module::where('route', 'erp_logs')->first()) {
$grandchildModule = new Module;
$grandchildModule->name = 'Log ERP';
$grandchildModule->icon = 'fa-list';
$grandchildModule->route = 'erp_logs';
$grandchildModule->order = 9;
$grandchildModule->module_id = $parent['id'];
$grandchildModule->save();
}
}
}