Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

onurzdgn's avatar

Laravel 11 error session() but it work

Hello everyone, I am using Laravel 11. Laravel gives me error in problems from session()->flash('message', ['success', ['Kategoriler başarıyla güncellendi.', 'Başarılı']]);, the message: Expected type 'object'. Found 'null'.. However it works. Actually I can't understand why give me error and why work if there is an error

0 likes
1 reply
martinbean's avatar

@onurzdgn Read the rest of the exception. It will tell you what file and line the error occurred on, and point you to what argument was expecting an object but you passed null instead.

Please or to participate in this conversation.