Support the ongoing development of Laravel.io →
posted 10 years ago
Authentication

Hi i add this code in the construct function of the controller $this->middleware('auth'); and works fine but when i wrote this $this->middleware('auth', ['only' => 'create']); it gives me Error Exception says Trying to get property of non-object !! what is wrong?

Last updated 3 years ago.
0

That function works fine for me. Try a different middleware as a test

0

Sign in to participate in this thread!

PHPverse

Your banner here too?

macnux macnux Joined 17 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.