Laravel @include controller data

I’m trying to receive data on a sidebar that is included in the blade template but i’m not getting any data delivered. I’ve tried adding @include(‘admin.sidebar’,[‘message_counter’ => $message_counter]) and in the sidebar view show as . I’m getting a Undefined variable: message_counter. My router: Route::get(‘/admin/sidebar’, [ ‘uses’ => ‘MessagesController@counter’, ‘as’ => ‘admin.sidebar’ ]); My controller…

I have 4 rows and 4 columns each row display images from different tables how to update any images in laravel framework

update function of laravel framework public function update(Request $request, $id) { if(isset($_POST[‘commer’])) { $commercial = BestCommercialPhoto::findOrFail($id); $input = $request->all();`enter code here` if($file = $request->file(‘file’)) { $name = time().$file->getClientOriginalName(); $file->move(‘images’,$name); $input[‘file’] = $name; } $commercial->update($input); } elseif(isset($_POST[‘fash’])) { $fashion = BestFashionPhoto::findOrFail($id); if($file = $request->file(‘file’)){ $name = time().$file->getClientOriginalName(); $file->move(‘images’,$name); $input[‘file’] = $name; } $fashion->update($input); } elseif(isset($_POST[‘wed’])) {…