Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

davy_yg's avatar
Level 27

APP_URL

What is APP_URL?

.env

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:w4+St3llrDOPqwLDu0eQ3VvBpScSphhFNMPybiF/yZ8=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost/victoryeshop/vito

config/app.php

'url' => env('APP_URL', 'http://localhost/victoryeshop/vito')

vito is the laravel framework name. I wonder if I set it correctly since I have my ecommerce front page picture unappearing.

0 likes
2 replies
TarekMonjur's avatar

The APP_URL is .env file environment variable for your application base path such as your domain http://example.com or http://localhost/{project name}/public if you should store your front page picture public/images folder then call url('images/{picture name}')

3 likes
MatteoOreficeIT's avatar

A more complete answer is :

  1. variable specific to actual environment which should contain the public URL to laravel main index.php file minus '/index.php' es: http://localhost/{subdir}/{projectRoot}/public/index.php minus /index.php == http://localhost/{subdir}/{projectRoot}/public

  2. a variable available when Laravel is invoked by CLI. In such as scenario the real app URL couldn't be guessed from HTTP Request, so an alternative method is needed, for example if you need to generate a link to a page from a CLI, es: via asset() function

4 likes

Please or to participate in this conversation.