How to use fontawesome with vue.js - elasticsearch

I was trying to use font-awesome with vue.js but couldn't got it running.
I tried including in the index but did not work:
<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">

Include in index.html
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
Now it should work

Related

Vite (in Laravel) cannot use with static assets from public directory

I have a problem when I update to laravel 9.19 (using vite instead of webpack).
In my project I using some static assets from public directory like <link rel="stylesheet" href="/css/assets/slick.css"> or <script src="/js/assets/slick.min.js"></script> and have 2 files to compile from resources like resources/sass/app.scss and 'resources/js/app.js', the same for .js files. On webpack I do something like this:
<link rel="stylesheet" href="{{ mix('/css/app.css') }}"><link rel="stylesheet" href="/css/assets/slick.css"> ... and
<link rel="stylesheet" href="{{ mix('/css/style.css') }}
the same situation for .js files and all works perfectlly. How I can do this with Vite
You can read the laravel docs, you should use the blade directive #vite() an use the project path:
#vite('resources/sass/app.scss')
#vite('resources/js/app.js')

Laravel 5.5 css path is not working under public directory

I have used the following to generate the CSS file:
<link rel="stylesheet" href="{{ asset('public/global/bower_components/bootstrap/dist/css/bootstrap.min.css') }}">
However, I see the css is not loading. From the view source, I see the below code which is not opening (404).
<link rel="stylesheet" href="http://127.0.0.1:8000/public/global/bower_components/bootstrap/dist/css/bootstrap.min.css">
But, if I remove the "public keyword" from the above path, its working.
I'm using php artisan serve in Ubuntu 16.04
<link rel="stylesheet" href="{{ public_path('global/bower_components/bootstrap/dist/css/bootstrap.min.css') }}">
<link rel="stylesheet" href="http://127.0.0.1:8000/global/bower_components/bootstrap/dist/css/bootstrap.min.css">
these two works. Because when 127.0.0.1:8000 load, it starts making the project from public path.
and asset(/path) is represent asset folder. You must change this with public_path
You can use asset() helper,
<link href="{{ asset('public/global/bower_components/bootstrap/dist/css/bootstrap.min.css') }}" type="text/css" rel="stylesheet">

Laravel linking assets files to root of domain but not subfolder that the site is in

I have a site that is www.project.example.com/apps/myapp and I have various javascript and css files linked like this
<link rel="stylesheet" type="text/css" href="{{asset('/css/app.css')}}"/>
<link rel="stylesheet" type="text/css" href="{{asset('/css/myapp.css')}}"/>
<script type="text/javascript" src="{{asset('js/app.js')}}"></script>
<script type="text/javascript" src="{{asset('js/vendor.js')}}"></script>
But I keep getting a 404 not found error because its looking for the files in www.project.example.com/css for example.. Its not even looking in the assets folder
How can I fix this without having to change the path for every css and javascript file?
fixed it. had to set base href in index.php and use relative links
<base href="/apps/myapp/"
<link rel="stylesheet" type="text/css" href="css/app.css'"/>
<link rel="stylesheet" type="text/css" href="css/myapp.css"/>

Laravel structure broken after deploying in shared host

i am deploying my project to shared hosting now. But i found that all the css file seem like not in correct directory. For example my original code is <link href="{{ asset('intro/css/style.css') }}" rel="stylesheet" type="text/css">
In server i need to change it to
<link href="public/intro/css/style.css" rel="stylesheet" type="text/css"> in order to make it work.
But i having thousand of line need to change if i had to update all.
Is there others way to do it?
I am using Cpanel and my file is located in public_html.
Try this
<link href="{{URL:: asset('intro/css/style.css') }}" rel="stylesheet" type="text/css">

How do i call css file in laravel?

Good day. I'm trying to call css in laravel. Here is the css url
<link rel="stylesheet" href="http://localhost:84/mycms/public/css/index.css">
It's working fine.
Then I'm trying the laravel way with this https://stackoverflow.com/a/16565640/6354277 . And i change it to this
<link rel="stylesheet" href="{{ URL::asset(css/index.css') }}">
It Seems i can't found the css file. How can i fix it ?
You may try this.
My css file is in public/css/sample.css
It works fine
<link href="{{ asset('css/sample.css') }}" rel="stylesheet" >

Resources