mardi 25 août 2015

Stripe + Laravel - Call to a member function subscribed() on null

This is very strange my subscription site was working yesterday but today it is giving me the error - Call to a member function subscribed() on null

I have checked my edited code in the last day and nothing obvious stands out.

My code is...

@if ( ! $user->subscribed())
                    <h1>You are not currently subscribed!</h1>
                    <a href="plans" class="btn btn-green btn-lg  btn-large">SUBSCRIBE</a>

                @elseif(Auth::guest())
                <h1>You need to be a member to view todays tips!</h1>
                    <a href="login" class="btn btn-green btn-lg  btn-large">LOGIN</a>
                    <a href="register" class="btn btn-blue btn-lg  btn-large">REGISTER</a>
                @else

                @forelse($todaystips as $tip)

                    <h3>{{ $tip->league }}</h3>
                    <h2>{{ $tip->home_team }} V {{ $tip->away_team }}</h2>
                    <h3><b>{{ $tip->tip }}</b>  {{ $tip->odds }}</h3>

                @empty<h1>There are no tips today! Check back tomorrow!</h1>

                @endforelse
                @endif

and the controller code is

public function home()
{

    $user = Auth::user();

    return view('home')->with([
        'user'                        => $user,

    ]);
}



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1MQo1DT
via IFTTT

Aucun commentaire:

Enregistrer un commentaire