Example #1
0
 public function createModels()
 {
     $tables = $this->request->input('models');
     foreach ($tables as $table => $model) {
         if (!empty($model)) {
             $model = studly_case(trim($model));
             $proto = new CrudModelPrototype(['name' => $model, 'table' => $table]);
             $proto->record();
         }
     }
     return redirect()->back();
 }
Example #2
0
 public function saveModel($table, $json)
 {
     $data = json_decode($json, 1);
     $proto = new CrudModelPrototype($table, $data);
     return $proto->record();
 }