Laravel File Manager dosn't load css, js files - laravel

I integrated Laravel File Manager in my laravel project and at first it worked properly, but after I remove public [ I followed this instruction remvove public from url ] from url it din't work anymore. The css file is missing and browse file also din't work. I tried to include those files**[css, js]** into head section also din't work. It still show like this
I have no idea how to fix this error. Can anyone help me please?

Related

laravel not picking file through asset()

In my laravel project i am trying to get js file though asset('js/app.js') which is inside public folder. it is working fine on localhost but on server it is not picking file. It is working on another server. I think there is any issue with htaccess file.
I try to use url() and URL::asset() but not working. I checked source of page link is perfect but still fail to pick file
I want to access that js file.
The question has been answered in the comments, and was solved with this code:
asset('public/js/app.js')

Laravel: Uploaded Files URL problems with Custom Public Path

In my Laravel 5.6 project, I have moved the public folder path from /public to /web to match the hosting environment. The entire project works fine without any issues.
However, the problem appears when I upload files and try to link them. I have searched all over and cannot find any solutions to this. I have used php artisan storage:link to link the storage. I should be able to access files put in the folder by http://localhost:8000/storage/test.png but the link comes up with the view provided for the route /, not the actual file itself.
It's as if all links to the files are being treated as routes and are showing the default route page instead of the file. I would really appreciate any assistance.
Screenshot:
https://i.imgur.com/IPa6JYh.png
I found the solution to the problem.
In the file core/server.php, I had this:
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
return false;
}
The public part was causing the issue. I set it to /../web to match my project's structure and the file linking started immediately afterwards.
Hope this helps someone.
Edit: the core directory is where I have moved all the Laravel files. The screenshot in the question has more details.

Laravel 5.4 #include not working - throws ErrorException View not found

I'm new to Laravel, using 5.4 in an XAMPP stack and I can't get the #include to work.
Forgive me if I ask some stupid questions here, but this is the first framework I've worked on in nearly two years, so I'm a bit rusty.
I have a view in the resources/views directory, and I just want to include some simple html divs which I would like to be in a separate .inc file.
Basically, I have an index.blade.php view in the resources/views/xxx directory, which works fine, but has divs of html which I'd like to get out of the way in a notes.inc.blade.php file, and then #include it into the index.
I've tried creating the .inc file in the same folder, then using #include('notes.inc') , but this doesn't work. I've also tried moving the inc file to the resources/views directory and then using #include('xxx.notes.inc') but again no joy. All I get is:
Whoops, looks like something went wrong.
(2/2) ErrorException
View [notes.inc] not found.
(View: C:\xampp\htdocs\xxxxxxx\resources\views\xxxxxxs\index.blade.php)
I haven't changed any path definitions or configs.
Most of the forums (fora?) that I have found are talking about Laravel 4, so is there anyone that can point me at some clear instructions on how to do it in 5.4?
Or am I missing something obvious?
I would be happy to provide sample code if anyone needs it.
The view paths are not relative, so if you use #include('xxx.notes.inc') in the resources/views/xxx/index.blade.php, your included template must be in resources/views/xxx/notes/inc.blade.php.

Laravel File Manager 404 error

I just installed Laravel file manager on my project and I don't understand why I get an NotFoundHttpException when I try to pop up the file manager.
I've installed it in many projects and it's the first time that I get this kind of error.
I already put the LaravelFilemanagerServiceProvider in my providers,
and the service provider is above the RouteServiceProvider
I've tried to clear the route cache, to publish all files etc...
When I do php artisan route:list I have the correct routes with the correct middlewares,
but on my browser impossible to access the file manager,
so with the console the routes appear to be correctly registered, but the browser does not find it
any idea how to proceed ? Thank you for your answers
I found the solution,
I used a pre-made code for the wysiwyg editor coming from Laravel File Manager website but the code was wrong,
Be careful in the "Integration" section, the code is not always correct with the default given configuration.

Laravel Router Not Allowing Javascript Files

I'm having a really crazy issue and I can't seem to figure it out. I've got an app that was working perfectly fine in Laravel 5.2, and I've since upgraded to Laravel 5.3. When I serve the standard view from routes/web.php and include a script tag, Laravel is trying to load the script tag as a route instead of including the file. Example:
If I add the folowing:
<script src="/js/lib/jquery.min.js"></script>
At the end of my welcome.blade.php (or index, or any of them really), I get the following in the console:
Console Error
And if I look into Sources in the Chrome devtools at the jquery file, it's loaded my same blade file as the JS file (like Laravel is trying to load it via the router). Does anyone have any hints on where I can look? I really don't want to go through the process of trying to reinstall or back out the an earlier version.
EDIT: To clarify, I've been working on this a bit, and it turns out that the app.js file will load just fine, but the js/lib/**.js files won't. I don't really know what the difference is.
How about that syntax?
<script type="text/javascript" src="{{ URL::asset('/js/lib/jquery.min.js') }}"></script>
Hope it helps you :)
That only happens when the file is not found. Check the file name again, the path and also remember pathname may be case sensitive.

Resources