samedi 26 août 2017

undefined variable uprofile laravel 5.4

I am using laravel framework 5.4 and write following controller class:

class ProfileController extends Controller
{
 public function index(){
      $uprofile = DB::table('user_profile')->find(Auth::id()); 
   return view('CityOfWorks.profile')->with('uprofile',$uprofile);
 }

route is:

Route::get('/','ProfileController@index');

At view I'm using

@foreach($uprofile as $profile)             
    $profile->id
    @endforeach

What seems wrong here?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire