process-drive/laravel-js-route

This library is using for call route method inside the javascript file

1.0.0 2022-10-05 12:35 UTC

This package is not auto-updated.

Last update: 2024-04-26 13:29:54 UTC


README

logo.png

ProcessDrive Laravel Route Using With JS File

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

This library is used for laravel route method is use for javascript file

Installation

The preferred way to install this extension is through composer.

run

composer require process-drive/laravel-js-route
                 (or)
composer require process-drive/laravel-js-route:1.0.0

After Installation

To set service provider to config/app.php file

 'providers' => [
        ProcessDrive\LaravelJsRoute\RouteServiceProvider::class,
    ]

To set view file in your appliction. you will set below code in common blade file

@include("LaravelJsRoute::JSRoute")
                 (or)
{{ view('LaravelJsRoute::DefineRoute') }}

Run this command

php artisan route:json

How it use

In javascript file you can use like this

Route :

route(laravel route name here)

route(users.index)

Route with Params:

route(Laravel route name here, Laravel route parameter here like object, Qurey parameter like object)

route(users.edit, {userid: 1}, {name: 'kaviyarasan'})

License

MIT