Support the ongoing development of →
posted 9 years ago
Last updated 2 years ago.

I had the same error. Do composer update and make sure your app directory is up to date with the latest changes in the upstream Laravel git repository

Last updated 2 years ago.

I have newest files and problem is still there. Any other sugestions?

Last updated 2 years ago.

For me the error was that I should use namespaces for the controllers in the helpers. The following gives me the weird error (Call to a member function domain() on a non-object).


Where by adding the namespace it started working. The error is not really helpful.

Last updated 2 years ago.

With the newly released version of Laravel 5, I experienced the exact opposite.

return redirect()->action('App\Http\Controllers\HomeController@index');

caused the domain() on null, where as the following:

return redirect()->action('HomeController@index');

worked fine. Quite misleading as the documentation specifies using the first approach... O_o

Update: So - it seems action() returns the url routing to this particular method. I was attempting to use it without an existing route to a method which works with neither of the approaches above. For good reason I guess. In my case I should probably just call the function specifically rather than using the routing system as a way to control my program flow.

In any case, my previous statement stands. Of the two methods, the latter works for me IF you've already defined a route for that particular method. Otherwise, both methods will return the null domain function thingy ka-jigger.

Last updated 9 years ago.

I had the same issue when misspelling my controller name in action().


action('UserController@update', $user->id) // causes the error.
action('UsersController@update', $user->id) // It should be this. (notice the s in Users)
Last updated 9 years ago.

Sign in to participate in this thread!


Your banner here too?

Albert221 albert221 Joined 13 Apr 2014


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

Your logo here?

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

© 2024 - All rights reserved.