Download the PHP package hsntngr/roux without Composer
On this page you can find all versions of the php package hsntngr/roux. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package roux
Short Description A laravel package that provide to use route names and actions in fetch calls
License MIT
Informations about the package roux
Roux API
Roux Api provide you to use route names and actions while sending fetch calls in laravel projects Note: Currently under development
Installation
install roux via composer
composer require teomanofficial/roux
Publish config and asset file of package.
php artisan vendor:publish --provider="Hsntngr\Roux\RouxServiceProvider" --tag="config" --tag="asset"
Add roux service provider to providers in config/app.php
Add roux.js above your custom javascript files
Then start to use roux api..
Let assume we have a user.greetings
route and takes two parameter.
with roux, you can use route name (user.greetings) as target.
call()
method takes three parameter, route, route parameters and fetch options. (Post data, headers, token etc.)
But you may pass above information in first parameter as ajax do
Instead of route names, also you may use route action as target
By default, roux looks for csrf token in dom and set csrf header.
You can work with any api more elegant way by setting up default roux for each service
now we can sand requests through postApi
Copyright MIT LICENCE