Support the ongoing development of Laravel.io →
Eloquent Views
Last updated 2 years ago.
0

do i have to pass an id to my dashboard route?

0

You also can use it

<img src="{{ \Auth::user()->userdetail->file_name }}" alt="user_auth" class="user-auth-img img-circle"/>

If file_name store only name of picture, you need add prefix with folder name e.g.

src="/files/useravatars/{{ \Auth::user()->userdetail->file_name  }}"

If i get you right, you can use Auth::id() or Auth::user()->id for get current logged user id's OR I think you mean how parse route with user id:

//in web.php (routes)
Route::get('/dashboard/user/{user}', 'DasboardController@getuser')->with('user', '[0-9]+');

//RouteServiceProvider.php in boot()
$this->model('user', 'App\Models\User');

Enjoy :)

Last updated 7 years ago.
0

thank you . I'll try this one. :)

0

This is my route. Do i have to include the /{id} in the admin/dashboard route?

  Route::group(['middleware' => ['auth','admin'], 'prefix' => 'admin'], function() {
        Route::get('dashboard', 'AdminController@index');
});
0

I get this error

Trying to get property of non-object (View: C:\xampp\htdocs\mypharma\resources\views\admin\partials\header.blade.php) (View: C:\xampp\htdocs\mypharma\resources\views\admin\partials\header.blade.php)

0

Sign in to participate in this thread!

Eventy

Your banner here too?

finger finger Joined 23 Jan 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.