mrweb
207
2
Laravel

How can I use Laravel Auth() in my custom Pacakge?

Posted 4 months ago by mrweb

I I'm building my package and is in packages/acme/packagename

In there I have a routes.php file.

I've ran php artisan make:auth and did migration and seeding, all fine.

Now I want to use it by calling it in my package acme/packagename/routes.php file.

I've tried this:

Auth::routes();

Then I copied the Auth Controllers and Views and changed the Auth/Controllers namespace to be

namespace Acme\Packagename\Http\Controllers\Auth;

It actually try to load the view but tries to look for it in the wrong place, saying:

View [auth.login] not found.

It looks in Project/resources/views/auth instead of looking into Acme/Packagename/src/resources/views/auth

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

Reply to

Use Markdown with GitHub-flavored code blocks.