Download the PHP package sukohi/laravel-js-helper without Composer
On this page you can find all versions of the php package sukohi/laravel-js-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download sukohi/laravel-js-helper
More information about sukohi/laravel-js-helper
Files in sukohi/laravel-js-helper
Download sukohi/laravel-js-helper
More information about sukohi/laravel-js-helper
Files in sukohi/laravel-js-helper
Vendor sukohi
Package laravel-js-helper
Short Description A Laravel package that provides helper functions for JavaScript like route(), dd() and constant().
License MIT
Homepage https://github.com/sukohi/js-helper
Package laravel-js-helper
Short Description A Laravel package that provides helper functions for JavaScript like route(), dd() and constant().
License MIT
Homepage https://github.com/sukohi/js-helper
Please rate this library. Is it a good library?
Informations about the package laravel-js-helper
laravel-js-helper
A Laravel package that provides helper functions for JavaScript like route()
, dd()
and constant()
.
Available versions:
- Laravel 9
- Laravel 8
- Laravel 7
- Laravel 6
Installation
Run the following command to install the package:
Then, publish a config file called config/js_helper.php
.
After that, set your route names and/or constants that you'd like to use in JavaScript in the file`.
Usage
<script src="/js/helper.js"></script>
<script>
window.onload = () => {
// URL from routes
const url = route('item.edit', 1); // <- here
console.log(url);
// Constants
const appName = constant('APP_NAME'); // <- here
console.log(appName);
// Debug
const str1 = 'Test 1';
const str2 = 'Test 2';
const str3 = 'Test 3';
dd(str1, str2, str3); // <- here
};
</script>
License
This package is licensed under the MIT License.
All versions of laravel-js-helper with dependencies
PHP Build Version
Package Version
Requires
illuminate/support Version
^6 ||^7 || ^8 || ^9
The package sukohi/laravel-js-helper contains the following files
Loading the files please wait ....