How to give the path of public folder file in view(.blade.php) file ? Dear Friends,
How to give the path of a file in public/audio/crow.ogg to a blade.php file in path reosurces/views/magazines ?
suppose please suggest here : source src="crow.ogg" type="audio/ogg"
how to rewrite the value of src ...
Please advise
Thanks
Anes
You can add simply-
{{ url('/') }}/audio/crow.ogg
Hope will work for you.
Try laravel helper function public_path . The public_path() function returns the qualified path to the public directory.
@insight You Are better off with using the URL facade and calling the asset method for this kind of situations.
{{ URL::asset('public/audio/crow.ogg') }}
just use {{ asset('audio/crow.ogg') }}, its will give public folder path
@insight
You can give a try with asset() than.
<td> <audio controls>
<source src="{{ asset('audio/crow.ogg') }}" type="audio/ogg">
Your browser does not support the audio element.
</audio>
</td>
Dear Saurabh,
It's 404 page . My query is how to set the route to access that file ?
Thanks
Anes
Dear friends ,
My problem is fixed. Typo in file name make the situation complicated.
So solution is : source src="{{ asset('audio/Crow.ogg') }}" type="audio/ogg"
Thanks alot all of You
Anes
Please sign in or create an account to participate in this conversation.