5.3 Redirect Action - not defined

Posted 2 years ago by Spillmester

Been months since I first learned Laravel. When I cam back I cant for the life of me get redirect()->action() to work. I have searched Google. But I have some missing piece that I miss.

In one controller I have:

    return redirect()->action('Pages\Member\Crew\[email protected]',

CrewController.php is in the namespace and folder App\Http\Controllers\Pages\Member\Crew;

And it has this function:

public function member(NPC $crewMember){
    return $this->memberTileSelected($crewMember, $crewMember->tile);

But I get this error:

InvalidArgumentException in UrlGenerator.php line 605: Action App\Http\Controllers\Pages\Member\Crew\[email protected] not defined.

I have tried defining various things in web.php like:

//Route::get('[email protected]', 'Pages\Member\Crew\[email protected]'); //Route::get('Pages\Member\Crew\CrewController','Pages\Member\Crew\[email protected]');

/* Route::resource('crewMember', '\App\Http\Controllers\Pages\Member\Crew\CrewController', [ 'member' => 'crewMember.member', 'only' => ['member'] ]); */

I actually do not need the browser to redirect. I want to jump the code running at another controller if that makes sense. And if there is a better way please let me know.

Please sign in or create an account to participate in this conversation.