Initial commit

This commit is contained in:
Chris Hunt
2024-02-17 19:06:51 +00:00
parent d184427016
commit 8fa870e8eb
6 changed files with 75 additions and 12 deletions

View File

@@ -35,16 +35,32 @@ class ItemController extends Controller
*/
public function dash(): View
{
$data['apps'] = Item::whereHas('parents', function ($query) {
$query->where('id', 0);
})->orWhere('type', 1)->pinned()->orderBy('order', 'asc')->get();
$treat_tags_as = \App\Setting::fetch('treat_tags_as');
$data['all_apps'] = Item::whereHas('parents', function ($query) {
$query->where('id', 0);
})->orWhere('type', 1)->orderBy('order', 'asc')->get();
$data["treat_tags_as"] = $treat_tags_as;
if ($treat_tags_as == 'categories') {
$data['categories'] = Item::whereHas('children')->with('children')->get();
$data['all_apps'] = Item::whereHas('parents', function ($query) {
$query->whereNot('id', 0);
})->orderBy('order', 'asc')->get();
} else {
$data['apps'] = Item::whereHas('parents', function ($query) {
$query->where('id', 0);
})->orWhere('type', 1)->pinned()->orderBy('order', 'asc')->get();
$data['all_apps'] = Item::whereHas('parents', function ($query) {
$query->where('id', 0);
})->orWhere('type', 1)->orderBy('order', 'asc')->get();
}
//$data['all_apps'] = Item::doesntHave('parents')->get();
//die(print_r($data['apps']));
// die(print_r($data));
return view('welcome', $data);
}