Skip to content

Instantly share code, notes, and snippets.

@fearrr
Last active May 12, 2016 15:52
Show Gist options
  • Save fearrr/ef7ad1b82a75a4ad45292d50a5945e59 to your computer and use it in GitHub Desktop.
Save fearrr/ef7ad1b82a75a4ad45292d50a5945e59 to your computer and use it in GitHub Desktop.

Установка компоненетов через композер

composer require laravelcollective/html:5.2.*

composer require appzcoder/crud-generator

Aliases

'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,

Providers

Collective\Html\HtmlServiceProvider::class,
Appzcoder\CrudGenerator\CrudGeneratorServiceProvider::class,

Публикация шаблонов

php artisan vendor:publish

Артизан команды для генератора

php artisan crud:generate Posts --fields="title#string, body#text"
    
php artisan crud:generate Posts --fields="title#string#required, body#text#required_with:title|alpha_num" --route=yes --pk=id --view-path="admin" --namespace=Admin --route-group=admin

Команды типовые

php artisan crud:generate Categories --fields="title#string#required, description#text#required, slug#string, img#string"

php artisan crud:generate Items --fields="categories_id#integer, title#string#required, code#string, description#text#required, slug#string, img#string" --route=no --pk=id

Опции

Ключ Значение
--fields Имя поля для форм и модели
--route Включить маршрут crud в routes.php? Да или Нет
--pk Название первичного ключа
--view-path Путь до "Видов"
--namespace Пространство имен контроллера
--route-group Префикс группы для маршрутов

Типы полей

  • string
  • char
  • varchar
  • password
  • email
  • date
  • datetime
  • time
  • timestamp
  • text
  • mediumtext
  • longtext
  • json
  • jsonb
  • binary
  • number
  • integer
  • bigint
  • mediumint
  • tinyint
  • smallint
  • boolean
  • decimal
  • double
  • float
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment