/** * Run the database seeds. * * @return void */ public function run() { $document_list = array(array('name' => 'Deployment Architecture'), array('name' => 'Technical Architecture'), array('name' => 'Service Catalogue'), array('name' => 'Integration Arhitecture'), array('name' => 'Capability Plan')); foreach ($document_list as $document) { \App\DocumentList::create($document); } }
$selected = \App\DocumentList::find($id); /* dd($selected);*/ $selected->delete(); return Redirect::to('admin/types'); }); Route::get('/admin/types/add', function () { return View::make('admin.add_types'); }); Route::post('/admin/types/add', function () { $input = Input::all(); $validity = Validator::make($input, array('name' => 'Required|Min:3|Max:80', 'description' => 'Max:100')); if ($validity->fails()) { $messages = $validity->messages(); return Redirect::back()->withErrors($validity); } else { \App\DocumentList::create(array('name' => $input['name'], 'description' => $input['description'])); return Redirect::to('/admin/types')->with('success', "Added Successful."); } }); Route::get('admin/docs/edit/{id}', function ($id) { $system_docs = \App\SystemDocument::find($id); return View::make('admin.edit_docs', array('system_docs' => $system_docs)); }); Route::post('/admin/docs/edit/{id}', function ($id) { $input = Input::all(); $validity = Validator::make($input, array('name' => 'Required|Min:3|Max:80', 'description' => 'Max:100')); if ($validity->fails()) { $messages = $validity->messages(); return Redirect::back()->withErrors($validity); } else { \App\SystemDocument::where('id', $id)->update(array('name' => $input['name'], 'description' => $input['description']));