skip to Main Content

So I have this structure in my app.blade.php

If statement check if user have subscription and if no shows sub page else show dashboard
enter image description here

I send all required variables to dashboard view like this

enter image description here

But when I’m trying to get variable in before-payment view I cant reach it.

enter image description here

I test it without If statement in Dashboard I can use all variables. So how can I use variables in this situation?

2

Answers


  1. You’re talking about the app.blade.php file where you call up your payment file, if I understand correctly.

    Is the dasboard.blade.php file also included in this app.blade.php file?

    your explanation isn’t too clear.Make sure you send the variable to the right file.

    Maybe this cas help you: @include(‘child’, compact(‘title’, ‘content’))

    Login or Signup to reply.
  2. I think its better if u passing to global view via AppServiceProvider ( boot function ).

    Just add :

    $plan = Plan::first();
    view()->share('plan', $plan);
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search