PHPackages                             sukohi/laravel-js-helper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sukohi/laravel-js-helper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sukohi/laravel-js-helper
========================

A Laravel package that provides helper functions for JavaScript like route(), dd() and constant().

1.0.0(4y ago)07MITPHP

Since Feb 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/SUKOHI/laravel-js-helper)[ Packagist](https://packagist.org/packages/sukohi/laravel-js-helper)[ Docs](https://github.com/sukohi/js-helper)[ RSS](/packages/sukohi-laravel-js-helper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

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
------------

[](#installation)

Run the following command to install the package:

```
composer require sukohi/laravel-js-helper
```

Then, publish a config file called `config/js_helper.php`.

```
php artisan vendor:publish --tag="laravel-js-helper-config"
```

After that, set your route names and/or constants that you'd like to use in JavaScript in the file`.

Usage
-----

[](#usage)

```

    window.onload = () => {

        // URL from routes
        const url = route('item.edit', 1); //
