fahad
2214
4
Laravel

How to use npm package in Laravel 5.4

Posted 1 year ago by fahad

I am trying to use https://www.npmjs.com/package/js-datepicker package in my Laravel 5.4 project. so far what i have done:

at bootstrap.js
--------------------

require('js-datepicker');

at app.js
------------

// after vue instance

const picker = datepicker('.schedule_date');


it shows me the following error: in console

Uncaught ReferenceError: datepicker is not defined
    at HTMLDocument.<anonymous> (orders:847)
    at mightThrow (app.js:7700)
    at process (app.js:7768)
(anonymous) @ orders:847
mightThrow @ app.js:7700
process @ app.js:7768

Any help is highly appreciated. Thanks

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.