Support the ongoing development of Laravel.io →
posted 9 years ago
Requests
Last updated 1 year ago.
0

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 1 year ago.
0

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

Last updated 1 year ago.
0

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).

action("HomeController@showWelcome") 

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

action("App\Http\Controllers\HomeController@showWelcome")
Last updated 1 year ago.
0

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.
0

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

Example:

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.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Albert221 albert221 Joined 13 Apr 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.

© 2024 Laravel.io - All rights reserved.