jeudi 27 août 2015

Check if session array has given value or not in Laravel 5

In Laravel 5, I have session array named 'rights' containing array of values as below:

array:3 [
  0 => {#319
    +"rightid": 4
  }
  1 => {#320
    +"rightid": 5
  }
  2 => {#321
    +"rightid": 6
  }
]

Now, I want to check if this session array has 'rightid' = 4. I've tried this:

@if (Session::has('rights.rightid', '4')) Hello @endif

But its not working. Can anyone please help.



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

Aucun commentaire:

Enregistrer un commentaire