add seed
This commit is contained in:
parent
1419882455
commit
e452d3b5f6
2 changed files with 19 additions and 2 deletions
|
@ -27,8 +27,16 @@ class ItemController extends Controller
|
|||
*/
|
||||
public function dash()
|
||||
{
|
||||
$data['apps'] = Item::doesntHave('parents')->pinned()->orderBy('order', 'asc')->get();
|
||||
$data['all_apps'] = Item::doesntHave('parents')->get();
|
||||
$data['apps'] = Item::whereHas('parents', function ($query) {
|
||||
$query->where('id', 0);
|
||||
})->pinned()->orderBy('order', 'asc')->get();
|
||||
|
||||
$data['all_apps'] = Item::whereHas('parents', function ($query) {
|
||||
$query->where('id', 0);
|
||||
})->orderBy('order', 'asc')->get();
|
||||
|
||||
//$data['all_apps'] = Item::doesntHave('parents')->get();
|
||||
//die(print_r($data['apps']));
|
||||
return view('welcome', $data);
|
||||
}
|
||||
|
||||
|
|
|
@ -194,5 +194,14 @@ class SettingsSeeder extends Seeder
|
|||
$setting->save();
|
||||
}
|
||||
|
||||
if(!$home_tag = \App\Item::find(0)) {
|
||||
$home_tag = new \App\Item;
|
||||
$home_tag->id = 0;
|
||||
$home_tag->title = 'app.dashboard';
|
||||
$home_tag->pinned = 1;
|
||||
$home_tag->type = 1;
|
||||
$home_tag->save();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue