Support the ongoing development of →
Session Database Blade
Last updated 3 months ago.

first: remove the user_id in the relations. It's the default key Eloquent will look for for that relation.


$user_order = $this->user->id;

if you are using the built in authentication use the following to get the user

$user = Auth::user();

Thank's for the answer. Is still no data on the page but here is what I forgot to mention in my question. This is the button for orders view

<li><a href="{{ URL::to('/users/orders') }}?_token={{ csrf_token() }}">My Orders</a></li>

and this is the route Route::get('/users/orders', ['uses' => '[email protected]', 'before' => 'auth|csrf']);


Well I got them like this:

    $orders = self::$user->orders()->orderBy('order_id', 'asc')->get();
    return View::make('site.users.orders', [
        'orders' => $orders

Sign in to participate in this thread!


Your banner here too?

vinsbg vinsbg vinsbg Joined 26 Aug 2014


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

Your logo here?

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

© 2022 - All rights reserved.