Commit be12d002 by Thomas Pfuhl

saving modified records

parent 44ca70fd
......@@ -141,7 +141,7 @@ Create the tables needed by GDM.
Populate the database tables.
Liquibase provides Seeder classes in the folder ``database/seeds``
- Table `users`: *administrator* : username=GDM_MANAGER_NAME email=GDM_MANAGER_EMAIL password=admin
- Table `users`: *administrator* : username=`GDM_MANAGER_NAME` email=`GDM_MANAGER_EMAIL` password=`admin`
- Table `users`: *test user*: username=test_user password=user (currently not used)
composer dump-autoload
......
......@@ -15,6 +15,7 @@
## Backend
- delete records
- create records
## Localisation
......
......@@ -67,7 +67,8 @@ class MakeModelsCommand extends GeneratorCommand {
*
* @var array
*/
protected $timestampRules = 'ends:_at'; //['ends' => ['_at']];
//protected $timestampRules = 'ends:_at'; //['ends' => ['_at']];
protected $timestampRules = 'equals:xxx'; // will be set to false
/**
* Contains the template stub for set function
......
......@@ -244,7 +244,7 @@ class CAP_NAMEController extends Controller {
$form = $formBuilder->create(\App\Forms\CAP_NAMEForm::class, [
'method' => 'POST',
'url' => route('TABLE_NAME.store'),
'url' => action('CAP_NAMEController@store'),
'model' => $record
]);
......
......@@ -37,6 +37,7 @@ echo "\nexecuting: " . $content . "\n";
system($content);
$code = file_get_contents('../../app/Forms/' . ucfirst($name) . 'Form.php');
$code = str_replace("'id', 'number'", "'id', 'hidden'", $code);
$code = str_replace("'submit')", "'submit', ['label' => 'Save', 'attr' => ['class' => 'btn btn-success']])", $code);
$code = str_replace("'reset')", "'reset', ['label' => 'Cancel', 'attr' => ['class' => 'btn btn-warning']])", $code);
file_put_contents('../../app/Forms/' . ucfirst($name) . 'Form.php', $code);
......
......@@ -30,13 +30,14 @@ Route::get('TABLENAME/aggregated', 'CTABLENAMEController@index_aggregated');
Route::get('TABLENAME/data', 'CTABLENAMEController@data');
Route::get('TABLENAME/{id}/datum', 'CTABLENAMEController@datum');
// FORBIDDEN, unless authenticated:
Route::get( 'TABLENAME/{id}/edit', ['middleware' => 'auth', 'uses' => 'CTABLENAMEController@show']);
Route::get( 'TABLENAME/{id}/edit', ['middleware' => 'auth', 'uses' => 'CTABLENAMEController@edit']);
Route::put( 'TABLENAME/{id}', ['middleware' => 'auth', 'uses' => 'CTABLENAMEController@show']);
Route::delete( 'TABLENAME/{id}', ['middleware' => 'auth', 'uses' => 'CTABLENAMEController@show']);
// since we are lazy, we use this shortcut:
Route::resource('TABLENAME', 'CTABLENAMEController');
// FORBIDDEN, unless authenticated:
Route::get( 'TABLENAME/create', ['middleware' => 'auth', 'uses' => 'CTABLENAMEController@show']);
Route::post( 'TABLENAME/store', ['middleware' => 'auth', 'uses' => 'CTABLENAMEController@store']);
Route::post( 'TABLENAME', ['middleware' => 'auth', 'uses' => 'CTABLENAMEController@show']);
PHPCODE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment