salehhashemi/laravel-post-link

dev-master 2023-01-13 14:58 UTC

This package is auto-updated.

Last update: 2024-12-13 19:13:09 UTC


README

Latest Version on Packagist Total Downloads Build Status

Post Link Component for Laravel

A simple package that provides a post-link component for Laravel. This component allows you to easily create links that, when clicked, will submit a form with a specified method (default is POST) and url. This is useful for creating links that delete or update resources, for example.

Installation

You can install the package via composer:

$ composer require salehhashemi1992/laravel-post-link

Usage

Once the package is installed, you can use the x-post-link component in your blade templates:

<x-post-link method="PUT" :url="route('notifications.mark-as-read', $notification->id)"
class="badge bg-danger rounded-pill float-end">
<i class="fe-x text-light"></i>
</x-post-link>

This will render a link that, when clicked, will submit a form with the method of "PUT" and the url of the mark-as-read action on the notifications controller with the notification id.

You can also pass a confirm attribute to the component, which will display a JavaScript confirm dialog before submitting the form.

Change log

Please see the changelog for more information on what has changed recently.

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email salpars2004@gmail.com instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.