Reputation: 327
I have a problem about laravel run without use php artisan serve command. I'm working in xampp/htdocs/works folder. I created a blog under htdocs/works folder and if i use php artisan not problem but i want to use without php artisan like localhost:8080/works/blog/ working but not find css and js files.
How can I solved it ?
Upvotes: 1
Views: 838
Reputation: 634
The best soulution which works every time, is using Elixir
Read the documentation, you can insert your files like
<link rel="stylesheet" href="{{ elixir('css/all.css') }}">
<script src="{{ elixir('js/app.js') }}"></script>
I recomend starting with Webpack.
Upvotes: 0
Reputation: 1
you can use the helper asset
<link href="{{asset('css/app.css')}}" rel="stylesheet">
here the official doc https://laravel.com/docs/5.4/helpers#method-asset
Upvotes: 0
Reputation: 53
The first place I would check is the resources/views/layouts/app.blade.php or any other views you are trying to access and make sure it use a relative path like:
<link href="/css/app.css" rel="stylesheet">
The root is /public for the path, so in this example, app.css should be in public/css/app.css
Hope this help.
Upvotes: 0