dcyilmaz/formajax
最新稳定版本:v1.0.7
Composer 安装命令:
composer require dcyilmaz/formajax
包简介
FormAjax converts your forms into forms that submit with ajax without refreshing the page.
README 文档
README
FormAjax is a javascript module that automatically submits your forms. In this way, you do not need to write extra xhr codes at the bottom of each page.
Installation
You can install the package via Composer:
Install package
composer require dcyilmaz/formajax
Publish public
php artisan vendor:publish --tag=public --force
Call the file in footer
<script src="{{ asset('vendor/formajax/formajax.js') }}"></script>
Things to watch out for!
Formajax's return type should be response json
{
status= true|false,
message="string"
}
For example, your method that brings a member in laravel should be like this
public function show(string $id)
{
$user = User::find($id);
return response()->json([
'status' => true,
'message' => view('admin.users.show', compact('user'))->render()
]);
}
Your status code must be 200 in the return type, otherwise the error confirm alert will warn you. You can modify the javascript file for further settings and editing.
统计信息
- 总下载量: 1.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-10