Support the ongoing development of Laravel.io →
Installation Configuration Authentication
Last updated 2 years ago.
0

If your public directory is not the document root of your server, this will happen. There are a few choices.

  1. Run php artisan serve with your command line interface. From there, you can access your development site most likely on http://localhost:8000, and everything will render correctly.

  2. Or, you can load all your assets (css, images, scripts, etc.) using the asset helper method. So instead of /css/app.css, you can do asset('css/app.css') and it will render out the full path. In other words, it will render out 'http://localhost/larapack/public/css/app.css'.

For your routes, instead of using the asset() helper, you can use other helper methods like route(). This accepts your route name. So, lets say you have something like this in your routes.php file...

Route::get('auth/login', ['as' => 'login', 'uses' => 'Auth\AuthController@getLogin']);

'login' would be the path name so route('login') would render out the full path to your login url, which would be http://localhost/larapack/public/auth/login

Last updated 9 years ago.
0

Thank you for answer thomastkim asset helper worked like charm it was not working earlier I forgot to include curly braces I was not familiar with those helper.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

adammalle adammalle Joined 28 Sep 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.