Closed jimgwhit closed 4 years ago
Hey jimgwhit,
It seems like no controllers or traits are supposed to be created when installing Jetsteam as it used to be with Laravel UI.
For your concerns about UI being deprecated, the GitHub page of the package says it should no longer be used on new Laravel projects, we have to use Jetstream instead.
Maybe you should give us more details about what you are trying to do with the auth that requires you to use the AuthenticatesUsers trait so we can help you.
@alxmtr v7 the UI had the mentioned trait, how in v8 do I duplicate the methods such as authenticated.
And where in v8 are the authentication traits located? Even the v8 docs state there are controllers and traits, where?
Laravel Fortify powers the auth features of Jetstream and is probably what you are looking for.
@alxmtr in vendor folder and saw controllers but what traits is the documentation referring to I saw no traits? Has all control over redirection been removed?
I usually pick a redirect location depending role.
Are there still traits you can override. I just can't seem to find them.
Laravel 8 has been released only 10 hours ago as I write this and the documentation is probably still referring to the auth traits and controllers from Laravel UI. It is misleading.
There are no traits like AuthenticatesUsers anymore in Jetstream and Fortify.
I also noticed that there's only one place in config to set where to redirect to once logged in.
However shouldn't there be an option somewhere, that way if an admin, redirect to admin page, if another role, redirect to another page, etc for a few other roles. This was easy in Prior versions, with the authenticated method.
Could you implement something similar in this version.
Not only myself, but I know many other users use this functionality.
Changed RouteServiceProvider line to
public const HOME = 'redirects';
//or
public const HOME = '/redirects';
Made a route:
Route::get('redirects', 'App\Http\Controllers\HomeController@index');
//or
Route::get('/redirects', 'App\Http\Controllers\HomeController@index');
And in HomeController it redirects depending on role:
public function index()
{
$role = Auth::user()->role;
$checkrole = explode(',', $role);
if (in_array('admin', $checkrole)) {
return redirect('dog/indexadmin');
} else {
return redirect('pet/index');
}
}
$role = Auth::user()->role;
$checkrole = explode(',', $role);
Adjust to how you get user role.
But hoping for a decent fix in the framework like a trait to use or something.
These out of date docs have been updated.
Also any one landing here, @snapey put a fix on the forum for redirects, see:
https://laracasts.com/discuss/channels/laravel/version-8-redirects I included there a small example. Either will work. Also see his link in the post.
Description: No Login Controller is created and no trait.
Tried
Also tried
Wasn't created. Also no Login controller was created. Where is the login controller?
I also use the authenticated method from the trait, but where is this trait now, no UI any more?
Is the UI still okay with version 8 (and future versions if I don't want jetstream), or is the UI deprecated, do you have to use jetstream. Not anything in docs about the laravel ui for Auth.
And I thought jetstream was optional, where is the AuthenticatesUsers.php trait now located.
The docs are leaving out so much it seems. The docs says there should be controller and trait: