Laravel Multiple Login Logout Password Reset User/Member and Admin Tutorial

When you work in CMS, it is pretty common you have multiple roles and permission.

Setting Up Multi-Authentication in Laravel 5.4+ (Part 1)

Or from Forum

https://laracasts.com/discuss/channels/laravel/password-reset-for-multiple-tables?page=1

However, for my own appoach kind of different from above solution.

I am using subdomain to different out the session. So I do no need to duplicate the controller. I can use the same flow as main domain used.

 

runcloud use two projects sharing the same media folder

If you have a chance using symlink in your project. E.g your media folder. You might be using a symlink to reference the same media directory.

When I deploy my project to live. I keep hitting `Cannot save image intervention image. NotWritableException in Image.php line 138`

I am sure I am using the same owner for both directories. However it kind of weird to having this error message.

Then I started to trace the path. I tested with andFile::isDirectory File::iswritable. Then I was having open_basedir restriction in effect. File(/) is not within the allowed path(s):

Then this made me proceed to next checking.Finally, I found out this OPEN_BASEDIR issue.

In runcloud they had provided OPEN_BASEDIR for security purpose.

So what you have to do is include your another project repo into. And they have warned you about the risk. Make sure you know what you are doing.

Laravel Valet with SubDomain

In order to allow to use Laravel Sub Domain Route in Your Laravel Valet.

Let’s say my project folder name is ‘forum’. I would like the forum users to have their own public profile page via sub-domain.

Here is my route file:-

Route::domain('{account}.forum.dev')->group(function () {
    Route::get('user/{id}', function ($account, $id) {
        //
    });
});

In my Valet Folder. I need to use a symlink to archive the goal. In my case, I use Ken as a test user. Unfortunately, you can’t archive it via wildcard in Valet.

ln -s forum ken.forum

That’s all. Happy Coding

Laravel Valet with localtunnel.me

There is a very power command with Laravel Valet which is valet share. However, the problem is the URL will not reserve. Once you restart the process, there will be new URL will be generated.

When I due with payment gateway, they required an URL can be accessed from outside. So localtunnel.me is the solution to keep the sub-domain.

Once you install localtunnel.me, here is the command:-

>lt --port 80 --subdomain mysubdomain --local-host foldername.dev

It will proxy the valet URL to match with the localtunnel URL.

However, you will still have another issue, all your website link is not showing mysubdomain.localtunnel.me, it is still pointing to foldername.dev.

In this case you can use Laravel URL class, URL::forceRootUrl('https://mysubdomain.localtunnel.me/');

It will change the URL to the input that you had set.

I hope this tutorial can help you in your development. Happy Coding~