skip to Main Content

laravel leftjoin on json

I have Raw query running as select meeting.id, GROUP_CONCAT(users.name separator " | ") AS present_user_id from `meeting` left join `users` on JSON_CONTAINS(meeting.present_user_id, JSON_ARRAY(users.id), '$') group by `meeting`.`id` Which provide proper result, I tried to convert same in Laravel 8 like…

VIEW QUESTION

compact(): Argument #2 must be string or array of strings, IlluminateDatabaseEloquentCollection given – PHP

$maincategory = Category::all(['id', 'category']); $maintable = Category::orderBy('id', 'DESC')->get(); $subcategory = Subcategory::all(['id', 'subcategory']); $subtable = Subcategory::orderBy('id', 'DESC')->get(); return view('admin.news.create', compact('maincategory', $maincategory, 'maintable','subcategory',$subcategory,'subtable')); am getting error on this return view('admin.news.create', compact('maincategory', $maincategory, 'maintable','subcategory',$subcategory,'subtable')); how to solve it?

VIEW QUESTION

How to pass action to Laravel 8 routes?

I was using following Route declaration to pass language action to the routes. Route::get('/de', ['uses' => 'PageController@showHomepage', 'language' => 'de']); And in controller, I was able to get this value like this: $action = $request->route()->getAction(); // $action['language'] gives the given…

VIEW QUESTION
Back To Top
Search