adrosoftware/notitia-visum

BREAD (浏览、阅读、编辑、添加、删除) 生成器用于 Laravel

0.1.0 2020-04-14 04:03 UTC

This package is auto-updated.

Last update: 2024-09-14 13:57:47 UTC


README

Build status Coverage Status Latest Stable Version License

这是一个工作包。 B阅读

Notitia Visum 是用于 Laravel 的 BREAD (浏览、阅读、编辑、添加、删除) 生成器

使用方法

浏览使用方法

/**
 * Inside a controller action
 */
return (new NotitiaVisum())
    ->table('users')
    ->browse();

您可以添加一个原始的 where 条件,如下所示

return (new NotitiaVisum())
    ->table('users')
    ->whereRaw('role = \'admin\'')
    ->browse();

如果您想过滤在表中显示的字段,您可以添加一个字段数组

return (new NotitiaVisum())
    ->table('users')
    ->whereRaw('role = \'admin\'')
    ->browse(['id', 'first_name', 'role']);

默认情况下,表标题是数据库中的表名,但您可以像这样覆盖它

return (new NotitiaVisum())
    ->table('users')
    ->title('System Users')
    ->browse(['id', 'first_name', 'role']);

测试

$ vendor/bin/phpunit

作者

Adro Rocker