I am working on a Laravel Project and I need some help
I am passing data from AdsController.php
$ads = Ads::all();
return view('Ads/index', enter code herecompact('ads','users'));
But in the Same view I want to get data from other tables
@foreach ($ads as $ad)
$ad->id // Now from this Id I want to get the user's name and picture so..
{{AdsControlller::get_user_img($ad->id)}}
@endforeach
in The AdsController I have the function
Public static function get_user_img($id){
$user = User::find($id);
return $user-img;
}
But I keep getting this error Class 'AdsController' not Found !