I have installed a Laravel 5.2 to run an existing project from my group mates but in my laptop, the project will only read inline CSS, it cannot read Linked CSS, What seems to be the problem?
you should use helper
url('path/to/css/file/in/public/folder')
First, put your assets in the public folder
Then you can use:
<link href="{{ url('path/file.css')}}" rel="stylesheet" type="text/css" />
Related
I'm trying to add the favicon to a Inertiajs app but it doesnt work.
I'm using laravel 9 with inertiajs, vue3 with vite and tailwind.
The route is fine "Public/Images"
Do any one understand why?
<link rel="icon" type="svg+xml" sizes="32x32" href="../../public/Images/Favicon.svg" />
laravel web folder is at public so all you need to do is reference it as the TLD,
in your resources/views/app.blade.php
you can directly reference a directory inside public, so instead of ../../public/Images/Favicon.svg it should be /Images/Favicon.svg
<link rel="icon" href="/Images/Favicon.svg" />
Error Message From Dev Tools
The Folder Structure of the project
How I linked this
So I am trying to Link local css file to thymeleaf but it has not been working. I was wondering how to link css to thymeleaf in this case. Thank you.
You are using href="#{/css/signup.css}", but you need to use th:href like this:
<link rel="stylesheet" th:href="#{/css/signup.css}" />
hello Laravel developers!
I am stuck with Laravel assets URLs.
<link href="/css/app.css" rel="stylesheet">
this link works fine on localhost.
But why i need to add "public" when i upload it to server like
<link href="/public/css/app.css" rel="stylesheet">
I moved app/public/index.php to app/index.php and make changes in server.php and index.php accordingly. Rest is the working fine. issue is only with assets urls.
Similarly, the class
.edu-home-hero-area {
background: url(/assets/images/curve.webp) !important;
}
works fine on localhost but when i upload it, it does not work i need to change it to
.edu-home-hero-area {
background: url(/public/assets/images/curve.webp) !important;
}
please have a look
https://pdaofficial.com/
any help would be appreciated
I'm not sure if i understand your question completely but you should not be moving public folder files some where else. why not reference your css or js assets using asset function. It will directly point to public folder and look for build.css inside css folder.
<link type="text/css" rel="stylesheet" href="{{ asset('css/build.css') }}">
I need to install Slim Cropper in Laravel (https://pqina.nl/slim/). I downloaded it and I have two files: slim.jquery.min and slim.min.css. How can I install it? I think I need to use the webpack.min.js, but I dont know how to use it. Thanks!
Well thats depends how you want do it. the quickest way could be simply, Add them to resources/layouts/app.blade.php in <head>. (assuming app.blade.php is your main layout file which you extending in all child views.) and use it like you would be using in normal html. Nothing Fancy. and for urls you can always use
<!-- Styles -->
<link href="{{ asset('css/slim.min.css') }}" rel="stylesheet">
<!-- script -->
<script src="{{ asset('js/slim.jquery.min.js') }}"></script>
which should load them from public/css and public/js folders.
read more about asset function here
https://laravel.com/docs/7.x/helpers#method-asset
I recently installed Laravel 5.2 and i´ve been experiencing some problems loading css and js files from the project public folder.
I have all my views on the resources folder and my asset files on the public folder, i tried installing html collective but is not working.
Could someone please help me link the css and js files, so they load.
This is my view:
<link href="assets/css/style.css" rel="stylesheet">
<link rel="stylesheet" href="/css/app.css" />
You can use the asset helper:
$url = asset('img/photo.jpg');
Cf docs: https://laravel.com/docs/5.2/helpers#method-asset