0

is it possible to check variable of the session like this my session is {{Session::get('package_id')}} and this display number but I want to it like this

  @if(Session::has('4'))
 <label>Your package is Free do you want to update?</label>@endif 

1 Answer 1

3

The proper way to use something like this

@if(Session::get('package_id')==4)
   package is free
@else
   Do another thing
@endif

or

<label>{{ Session::get('package_id')==4 ? 'Free':'Paid' }}</label>
Sign up to request clarification or add additional context in comments.

2 Comments

Parse error: syntax error, unexpected ':', expecting '(' (View: C:\xampp\htdocs\
<label>{{ (Session::get('package_id')==4) ? 'Free':'Paid' }}</label>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.