HANZO SALAH HANZO SALAH - 7 months ago 77
PHP Question

Blank page on laravel 5

I just try to create a profile page i create a Route like this:

Route::get('profile/{id}/{name}','ProfileController@index');


and the index function like this :

public function index($id,$name)
{
$user = \App\User::find($id);
return view('pages.profile',compact('user'));
}


profile view:

@extends('app')

@section('content')

<div class="container" style="margin-top: 50px;padding: 30px;">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="proPic"><img src="{{user->image}}" class="img-responsive" alt="Image"></div>
</div>
</div>
</div>
@endsection


but when I lunch the link i get a blank page

BeS BeS
Answer

If you have a default installation, you probably need to have:

@extends('layouts.app')

instead of

@extends('app')

and change

{{user->image}}

to

{{ $user->image }}

Comments