Download the PHP package james.xue/laravel-admin-sortable without Composer
On this page you can find all versions of the php package james.xue/laravel-admin-sortable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download james.xue/laravel-admin-sortable
More information about james.xue/laravel-admin-sortable
Files in james.xue/laravel-admin-sortable
Download james.xue/laravel-admin-sortable
More information about james.xue/laravel-admin-sortable
Files in james.xue/laravel-admin-sortable
Vendor james.xue
Package laravel-admin-sortable
Short Description description...
License MIT
Homepage https://github.com/laravel-admin-ext/laravel-admin-sortable
Package laravel-admin-sortable
Short Description description...
License MIT
Homepage https://github.com/laravel-admin-ext/laravel-admin-sortable
Please rate this library. Is it a good library?
Informations about the package laravel-admin-sortable
这个扩展包用来 sortable
Screenshot
Installation First, install dependencies:
composer require james.xue/laravel-admin-sortable
Second, Modified model
use James\Sortable\SortableTrait;
use James\Sortable\Sortable;
class Test extends Model implements Sortable
{
use SortableTrait;
public $sortable = [
'sort_field' => 'status', // 排序字段
'sort_when_creating' => true, // 新增是否自增,默认自增
];
}
Configuration In the extensions section of the config/admin.php file, add some configuration that belongs to this extension.
'extensions' => [
'sortableColumn' => [
// set to false if you want to disable this extension
'enable' => true,
]
]
User
$grid = new Grid(new Test);
$grid->model()->orderBy('status', 'asc'); // 这个很重要,否则页面显示顺序不正确
$grid->status('状态')->sortableColumn('\App\Test'); // sortableColumn 里面必须填入当前模型的 namespace ,
OR
$grid->status('状态')->sortableColumn(Test::class);
All versions of laravel-admin-sortable with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.0.0
encore/laravel-admin Version ~1.6
james.xue/laravel-sortable Version ~1.1
laravel/framework Version >= 5.4
encore/laravel-admin Version ~1.6
james.xue/laravel-sortable Version ~1.1
laravel/framework Version >= 5.4
The package james.xue/laravel-admin-sortable contains the following files
Loading the files please wait ....