jensramakers/laravel-async-route

There is no license information available for the latest version (v1.0.1) of this package.

laravel async route class

v1.0.1 2022-11-01 21:15 UTC

This package is not auto-updated.

Last update: 2024-12-26 06:00:30 UTC


README

install composer package

composer require jensramakers/laravel-async-route

publish views

php artisan vendor:publish --provider="Jensramakers\LaravelAsyncRoute\LaravelAsyncRouteServiceProvider"

install jquery

npm i jquery

and include it in your javascript file

window.$ = window.jQuery = require('jquery');

asyncDeletionModal = function (url) {
    let el = $("[data-async-container='deletionModal']")[0];
    el.innerHTML = '';
    $.get(url, function (data) {
        el.innerHTML = data;
    });
}

add this to web.php with needed middleware

Route::get('/admin/modal/deletion/{route}', function ($route) { 
  return view('vendor.jensramakers.modal_delete', ['route' => str_replace('\\', '/', $route)])->render();
})->name('admin.deletion.async.modal');

install tailwind elements for modal functionality https://tailwind-elements.com/quick-start/

install fontawesome

npm install --save @fortawesome/fontawesome-free

and add this line in your scss file

@import '~@fortawesome/fontawesome-free/css/all';