Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing calendar in laravel 10 "standard" instrallation (admin-lte version) [ "$ is not a function" and "jQuery is not a function" solved] #70

Open
magojr opened this issue Dec 3, 2024 · 0 comments

Comments

@magojr
Copy link

magojr commented Dec 3, 2024

Deployed the infyom generator with L10 in a standard environment (following the instructions on laravel and Infyom site).
I've been dealing with "jQuery is not a function", "$ is not a function"
=> solved switching from
import 'jquery';
to
import jQuery from 'jquery'; window.$ = jQuery;
in resources/js/app.js and executing "npm run build" in order to bring the updates inside the unified/mi9nified js.

After that the generated CRUD was working also with datartables except for the datetimepicker that is used for date and toimestamp fields. It seems nomore installed/imported from the app.

in the Laravel 9 version Infyom was using the bootstrap-datetimepicker from https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js. In this new version it's just called inside the fields.blade.php file but it's not present in any page or app asset.

I tried to search for in inside npm_modules but it's not present.
I tried installing it using npm install bootstrap-datetimepicker (with also the Momentum lib) biyt it copnflicts in some way with the installed jquery version.

The only way I menaged to get it working is to copy the old lines in the version 9 generator admin-lte template and insert them inside the new template in vendor/infyomlabs/laravel-ui-adminlte/resources/views/components/adminlte-layout.blade.php
and it worked but it's not the right way and it doesn't get correctly visualized (probably some css are not anymore correct in that version). This last solution worked but it's a hugly solution, it's probably not a solution at all but a (bad) workaround.

Can someone help me in finding the right way to bring it back working also on Laravel 10?
I'm not a fun of npm and js/css deployment system in general and I'm not experienced in that but it became the standard on L10 so I have to deal with it.

Thank you,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant