1

FatalErrorException Can't use function return value in write context. Is this some syntax problem or what?

        $result1 = Some query here
        $result2 = Some query here
        $result3 = Some query here

//error start here
        session('sessionVariable1') = $result1 
        session('sessionVariable2') = $result2 
        session('sessionVariable3') = $result3 
1
  • you cannot assign the result of a function, you should use it as dbr below shows you: put the var in an array and pass it to the session helper Commented Jul 31, 2017 at 17:22

1 Answer 1

3

Check the docs.

// Via the global helper...
session(['key' => 'value']);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.