Laravel-admin grid-sortable

Overview

laravel-admin grid-sortable

This extension can help you sort by dragging the rows of the data list, the front end is based on jQueryUI sortable, and the back end is based on eloquent-sortable

这个插件可以帮助你通过拖动数据列表的行来进行排序,前端基于jQueryUI sortable, 后端基于eloquent-sortable

Kapture 2019-06-25 at 10 14 51

Installation

composer require laravel-admin-ext/grid-sortable -vvv

Publish asserts

php artisan vendor:publish --provider="Encore\Admin\GridSortable\GridSortableServiceProvider"

Usage

Define your model



use Illuminate\Database\Eloquent\Model;
use Spatie\EloquentSortable\Sortable;
use Spatie\EloquentSortable\SortableTrait;

class MyModel extends Model implements Sortable
{
    use SortableTrait;

    public $sortable = [
        'order_column_name' => 'order_column',
        'sort_when_creating' => true,
    ];
}

Use in grid

$grid = new Grid(new MyModel);

$grid->sortable();

This will add a column to the grid. After dragging one row, a Save order button will appear at the top of the grid. Click to save order.

Translation

The default text for the button is Save order. If you use an other language, such as Simplified Chinese, you can add a translation to the resources/lang/zh-CN.json file.

{
    "Save order": "保存排序"
}

Donate

Help keeping the project development going, by donating a little. Thanks in advance.

PayPal Me

-1

License

Licensed under The MIT License (MIT).

You might also like...
Laravel package for giving admin-created accounts to users via 'set-password' email.

Invytr When making a website where users are created instead of registering themselves, you are faced with the challenge of safely giving users the ac

Simple project to send bulk comma-separated emails using laravel and messenger module from quick admin panel generator.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Voyager - The Missing Laravel Admin
Voyager - The Missing Laravel Admin

Voyager - The Missing Laravel Admin Made with ❤️ by The Control Group Website & Documentation: https://voyager.devdojo.com/ Video Tutorial Here: https

Fully customizable and tests supported Laravel admin dashboard for developers.

Laravel Admin dashboard Like Laravel Jetstream but built with Hotwire Turbo + additional perks. Tools used: tailwindcomponents/dashboard Hotwire Turbo

👻 It's never been easier to build and customize admin panels. Yah! yaldash is a beautifully designed administration panel for Laravel.
👻 It's never been easier to build and customize admin panels. Yah! yaldash is a beautifully designed administration panel for Laravel.

👻 It's never been easier to build and customize admin panels. Yah! yaldash is a beautifully designed administration panel for Laravel.

CoreUI Free Laravel Bootstrap Admin Template
CoreUI Free Laravel Bootstrap Admin Template

CoreUI Free Laravel Bootstrap Admin Template Curious why I decided to create CoreUI? Please read this article: Jack of all trades, master of none. Why

Free and open-source Laravel admin dashboard interface built with Livewire & Alpine.js based on Bootstrap 5
Free and open-source Laravel admin dashboard interface built with Livewire & Alpine.js based on Bootstrap 5

Volt Dashboard Laravel Free Frontend Web App for Laravel with Livewire & Alpine.js Never start a development project from scratch again. We've partner

Customize Login and Register Page for User/Admin in Laravel v8

Customize Login and Register Page for User/Admin in Laravel v8

A Laravel Admin Starter project with Page Builder, Roles, Impersonation, Analytics, Blog, News, Banners, FAQ, Testimonials and more

Laravel CMS Starter Project A Laravel CMS Starter project with AdminLTE theme and core features. Preview project here User: [email protected]

Comments
  • Removes wait for app boot for routes registration

    Removes wait for app boot for routes registration

    Waiting for app to boot causes the routes to register late, at the end of the routes list. May cause overriding of user defined routes. Or in my case, a "catch all" route which caught the _grid-sortable_ route (because it was prior in the routes list).

    opened by vladkucherov 1
  • Change

    Change "Save order" button to different language

    I put 'Save order' => "並び順を保存", in my lang/ja/admin.php file but still It's in English. How do I change it to Japanese?

    my lang/ja/admin.php file:

    <?php
    
    return [
        'online'                => 'オンライン',
        'login'                 => 'ログイン',
        'logout'                => 'ログアウト',
        'setting'               => '設定',
        'name'                  => '名称',
        'username'              => 'ユーザーID',
        'password'              => 'パスワード',
        'password_confirmation' => '確認用パスワード',
        'remember_me'           => 'ログイン状態を記憶',
        'user_setting'          => 'ユーザー設定',
        'avatar'                => 'アバター',
        'list'                  => '一覧',
        'new'                   => '新規',
        'create'                => '作成',
        'delete'                => '削除',
        'remove'                => '消去',
        'edit'                  => '編集',
        'view'                  => '表示',
        'continue_editing'      => '編集を続ける',
        'continue_creating'     => '作成を続行する',
        'detail'                => '詳細',
        'browse'                => '参照',
        'reset'                 => 'リセット',
        'export'                => '出力',
        'batch_delete'          => '一括削除',
        'save'                  => '保存',
        'refresh'               => '再読込',
        'order'                 => '順序',
        'expand'                => '展開',
        'collapse'              => '縮小',
        'filter'                => 'フィルタ',
        'search'                => 'サーチ',
        'close'                 => '閉じる',
        'show'                  => '表示',
        'entries'               => '件',
        'captcha'               => 'Captcha',
        'action'                => '操作',
        'title'                 => 'タイトル',
        'description'           => '概要',
        'back'                  => '戻る',
        'back_to_list'          => '一覧へ戻る',
        'submit'                => '送信',
        'menu'                  => 'メニュー',
        'input'                 => '入力',
        'succeeded'             => '成功',
        'failed'                => '失敗',
        'delete_confirm'        => '本当に削除しますか?',
        'delete_succeeded'      => '削除しました!',
        'delete_failed'         => '削除に失敗しました!',
        'update_succeeded'      => '更新しました!',
        'save_succeeded'        => '保存しました!',
        'refresh_succeeded'     => '更新しました!',
        'login_successful'      => 'ログインしました!',
        'choose'                => '選択',
        'choose_file'           => 'ファイルを選択',
        'choose_image'          => '画像を選択',
        'more'                  => '続き',
        'deny'                  => '権限がありません。',
        'administrator'         => '管理者',
        'roles'                 => '役割',
        'permissions'           => '権限',
        'slug'                  => 'スラッグ',
        'created_at'            => '作成日時',
        'updated_at'            => '更新日時',
        'alert'                 => '注意',
        'parent_id'             => '親ID',
        'icon'                  => 'アイコン',
        'uri'                   => 'URI',
        'operation_log'         => '操作ログ',
        'parent_select_error'   => '親ID選択エラー',
        'pagination'            => [
            'range' => '全 :total 件中 :first - :last 件目',
        ],
        'role'                  => '役割',
        'permission'            => '権限',
        'route'                 => 'Route',
        'confirm'               => '確認',
        'cancel'                => '取消',
        'http'                  => [
            'method' => 'HTTP method',
            'path'   => 'HTTP path',
        ],
        'all_methods_if_empty'  => '空欄の場合は全て',
        'all'                   => '全て',
        'current_page'          => '現在のページ',
        'selected_rows'         => '選択行のみ',
        'upload'                => 'アップロード',
        'new_folder'            => '新規フォルダ',
        'time'                  => '日時',
        'size'                  => 'サイズ',
        'listbox'               => [
            'text_total'         => '計 {0} 個のアイテム',
            'text_empty'         => '空のリスト',
            'filtered'           => '{0} / {1}',
            'filter_clear'       => '全て表示',
            'filter_placeholder' => 'フィルタ',
        ],
        'menu_titles'           => [],
        'Save order' => "並び順を保存",
    ];
    
    opened by miaK1110 0
  • Multi sortable grid in single page supported!

    Multi sortable grid in single page supported!

    What‘s New?

    使用ID Selector替代了SaveOrderBtn中的Class Selector

    Why?

    当需要在一个Form中添加多个Sortable Grid时, 由于之前使用Class Selector导致点击’Save Order‘后触发重复提交。现在使用Grid Name区分不同按钮,如果一个页面中只存在一个Sortable Grid则用法保持不变,存在多个Sortable Grid时通过$grid->setName('xxx');提供标识从而避免重复提交

    opened by Superoryco 0
  • 看起来是不是手册少写了些代码,在form里面要保存order字段?

    看起来是不是手册少写了些代码,在form里面要保存order字段?

    <?php
    
    namespace App\Models;
    
    use Illuminate\Database\Eloquent\Model;
    use Illuminate\Database\Eloquent\SoftDeletes;
    
    use Spatie\EloquentSortable\Sortable;
    use Spatie\EloquentSortable\SortableTrait;
    
    class Product extends Model implements Sortable
    {
        use SoftDeletes,SortableTrait;
    
        protected $table = 'product';
    
        public $sortable = [
            'order_column_name' => 'order',
            'sort_when_creating' => true,
        ];
    
    }
    
    
    opened by ghost 3
Releases(v1.1)
Owner
Extensions for laravel-admin
Extensions for laravel-admin
Extensions for laravel-admin
Sortable behaviour for Eloquent models

Sortable behaviour for Eloquent models This package provides a trait that adds sortable behaviour to an Eloquent model. The value of the order column

Spatie 1.2k Dec 22, 2022
Custom Blade components to add sortable/drag-and-drop HTML elements in your apps.

Laravel Blade Sortable Demo Repo Installation You can install the package via composer: composer require asantibanez/laravel-blade-sortable After the

Andrés Santibáñez 370 Dec 23, 2022
Laravel Grid is a package that helps you display table data.

Laravel Grid Laravel Grid is a package that helps you display table data. I could not find package that would satisfy my needs so I decided to write o

null 9 Nov 29, 2022
Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.

Webdevetc BlogEtc - Complete Laravel Blog Package Quickly add a blog with admin panel to your existing Laravel project. It has everything included (ro

WebDevEtc. 227 Dec 25, 2022
An open source Laravel Soundboard with Admin Panel CRUD (Create Read Update Delete) built on Laravel, Bootstrap, and Vue.js

Laravel Soundboard An open source Laravel Soundboard with Admin Panel CRUD (Create Read Update Delete) built on Laravel 5.8, Bootstrap 4, Vue.js, Boot

Jeremy Kenedy 24 Oct 28, 2022
Specially customized Laravel jetstream's scaffolding for Frest html + laravel admin Template

frest-html-laravel-jetstream Specially customized Laravel jetstream's scaffolding for Frest html + laravel admin Template. It'll not work with any oth

PIXINVENT CREATIVE STUDIO 0 Apr 5, 2022
Laravel Ajax Datatable is a nice laravel admin panel which includes authentication, CRUD and Ajax datatable.

Laravel Ajax Datatable is a nice laravel admin panel which includes authentication, CRUD and Ajax datatable. the datatable is created with laravel & ajax so No need to install another package, yout can do search, sort, paginate and show records per page fastly.

Jumah 3 Oct 3, 2022
dcat laravel-admin extension for china distpicker

dcat-admin extension Distpicker是一个中国省市区三级联动选择组件,这个包是基于Distpicker的dcat-admin扩展,用来将Distpicker集成进dcat-admin的表单中. 此扩展参考与引用: dcat-admin-extensions-distpick

mu 20 Oct 9, 2022
Easy-to-install Admin Panel for Laravel

CSS Framework: https://0notole.github.io/elements.css/ Install project: composer create-project --prefer-dist laravel/laravel screen, cd screen Add re

Anatoly Silko 3 Aug 25, 2021
Laravel Seo package for Content writer/admin/web master who do not know programming but want to edit/update SEO tags from dashboard

Laravel Seo Tools Laravel is becoming more and more popular and lots of web application are developing. In most of the web application there need some

Tuhin Bepari 130 Dec 23, 2022