dev-master
9999999-devCrud module to fast
The Requires
by Dmitry S
v0.1
0.1.0.0Crud module to fast
The Requires
by Dmitry S
Crud module to fast
Laravel Crud Module, (*1)
Execute the following command in your terminal, (*2)
composer require oldy/crud-module
Or add this line in your composer.json file, (*3)
require": { ... "oldy/crud-module" : "dev-master" }
And execute the following command in your terminal, (*4)
composer update
àííûé ïàêåò ïðåäîñòàâëÿåò îáùèå ôóíêöèè äëÿ áûñòðîãî ñîçäàíèÿ CRUD íà îñíîâå ìîäåëè è ôîðìû., (*5)
 ïåðâóþ î÷åðåäü íåîáõîäèìî ñîçäàòü ìîäåëü. Ïî óìîë÷àíèþ ìîäåëü áóäåò èñêàòüñÿ â êàòàëîãå Entity, íî ýòî ðàñïîëîæåíèå ìîæíî èçìåíèòü â êîíôèãå ```$xslt 'models_folder' => 'Entities',, (*6)
'forms_folder' => 'Http\Forms', (*7)
Âàæíî çàìåòèòü: ÷òî áû ìîäåëè è ôîðìû ïîäãðóæàëèñü àâòîìàòè÷åñêè îíè äîëæíû èìåíîâàòüñÿ
ñëåäóþùèì îáðàçîì.
- Íàçâàíèå ìîäåëè - ýòî íàçâàíèå êîíòðîëëåðà â åäèíñòâåííîì ÷èñëå
- Íàçâàíèå ôîðìû - ýòî Íàçâàíèå êîíòðîëëåðà â åäèíñòâåííîì ÷èñëå + ïîñòôèêñ Form. Íàïðèìåð GroupForm
, (*8)
Òåïåðü ñîçäàåì êîíòðîëëåð. Êëàññ êîíòðîëëåðà íàñëåäóþòñÿ îò ðîäèòåëüñêîãî êëàññà CrudController
, (*9)
$titles
- ñîäåðæèò ìàññèâ íàçâàíèé, 1 - äëÿ ñïèñêà, 2- äëÿ äîáàâëåíèÿ/ðåäàêòèðîâàíèÿ, (*10)
$relations
- ñîäåðæèò ìàññèâ ñî ñâÿçÿìè, êîòîðûå íåîáõîäèìî ïîäãðóæàòü/îáíîâëÿòü, (*11)
Ïîñëå ýòîãî ïðîïèñûâàåì ðîóò, (*12)
Route::resource('/group', Modules\Users\Http\Controllers\GroupsController);
È CRUD ãîòîâ., (*13)
Crud module to fast
Crud module to fast