Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon How do I set the ADMIN_APP_PATH environment variable in Laravel Sail
    Laravel Sail Twill ADMIN_APP_PATH customize admin path environment variable .env file Laravel development


How do I set the ADMIN_APP_PATH environment variable in Laravel Sail


To set the `ADMIN_APP_PATH` environment variable for Twill in a Laravel Sail environment, you can follow these steps:

1. Update the `.env` file:

In your project's `.env` file, add the following line to specify the custom admin path:


   ADMIN_APP_PATH=/custom-admin-path
   

This will make the Twill admin console available at `https://localhost/custom-admin-path` instead of the default `/admin` path.

2. Verify the Environment Variable in Sail:

Start your Laravel Sail environment using the `./vendor/bin/sail up` command. Once the environment is running, you should be able to access the Twill admin console at `https://localhost/custom-admin-path`.

That's it! By setting the `ADMIN_APP_PATH` environment variable in your `.env` file, you've successfully customized the admin path for Twill in your Laravel Sail environment.

Remember that if you're using a subdomain for the Twill admin console (e.g., `https://admin.example.com`), you'll need to set the `ADMIN_APP_URL` environment variable instead of `ADMIN_APP_PATH`. The process is similar, but you'll need to ensure that the subdomain is properly configured in your development environment (e.g., adding an entry to your `/etc/hosts` file).

Citations:
[1] https://laravel.com/docs/11.x/sail
[2] https://laracasts.com/discuss/channels/laravel/is-there-a-way-to-make-laravel-sail-use-a-different-path
[3] https://laracasts.com/discuss/channels/laravel/installing-sail-in-existing-laravel-9-project?reply=883429
[4] https://stackoverflow.com/questions/67053449/unable-to-set-the-app-port-on-env-for-laravel-sail
[5] https://tech.codivores.com/ltivt-4-laravel-twill-basics