This is the if:
Session::has('tk') ? Session::get('tk') : 1;
I would like to skip the : 1 but then it fails for some reason while tk is allways set in another if?
if you already know that tk has a value, then you don't need to use has() function to check it.
Use just:
Session::get('tk');
In a short if, you need to define both:
<?php
$var = ($someThing) ? true: false;
If you don't want to do that, take a regular if-statement
<?php
if ($someThing) {
$var = true;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With