jeroennoten / Laravel-AdminLTE

Easy AdminLTE integration with Laravel
MIT License
3.78k stars 1.08k forks source link

[QUESTION]: vendor/adminlte/dist folder in public still needed? #1279

Closed schonhose closed 2 months ago

schonhose commented 2 months ago

I am in the process of updating and cleaning my laravel installation. In the public folder there is currently a vendor/adminlte/dist folder containing css, img and js folders (from 2020). Are these still needed or can these be removed? I am thinking this is a leftover from previous installs (all the way back to laravel 6.x).

I have noticed that two blade files still have code linking to these files:

@extends('adminlte::master')

@section('adminlte_js')
    <script src="{{ asset('vendor/adminlte/dist/js/adminlte.min.js') }}"></script>
    @stack('js')
    @yield('js')
@stop

However, since these file extend the adminlte::master I am thinking the script call is redundant and can be removed.

dfsmania commented 2 months ago

@schonhose Yes, these are the distribution files of the AdminLTE v3.2 package, they are required by this package to work. You can check what files we currently use from the public folder on:

https://github.com/jeroennoten/Laravel-AdminLTE/blob/master/resources/views/master.blade.php

On the other hand, any blade file defined by your own and extending the adminlte::page shouldn't include the AdminLTE Javascript file again. The one that you've shared is extending the adminlte:master resource, I'm not sure why it has been defined like that, is it a custom file or an old file from this package? what's the path to that file?

schonhose commented 2 months ago

@dfsmania Thanks for the update. I probably need to update these files manually from the latest release of the AdminLTE package as these files that I have seem to be from 2020. Or is there an easy way to update the vendor files in the public folder? I also noticed some other plugins are needed by the package, so I should probably update these as well.

As for the code that I shared, this is a custom file, specifically a lock screen resource that is shown when the application is locked. This file extends the adminlte::master resource as it is only a form where the user can enter their password to unlock the application again. All other pages, part of the interface with the menus and such, do extend the adminlte::page resource.

dfsmania commented 2 months ago

The updating procedure is explained on the Wiki pages here, but in your case I recommend to backup your project before applying it.

What's the current version you're using from this package? Have you published the view resources from this package?

schonhose commented 2 months ago

Thanks for the link, not sure how I missed that.

The current package version is "dev-master" and I did not publish any view resources (i.e., there is no adminlte folder in the resources\views\vendor folder which seems to be the most logical place if I would have published the resources).

[Update] The update of the resources went ok. I also checked the plugins and there was only one that needed to be updated.

dfsmania commented 2 months ago

@schonhose Good, be careful about using dev-master, since a composer update may introduce a breaking change in your project silently. The recommendation is to jump between releases versions, and check the releases notes when the major version is increased (those jumps usually includes breaking changes).