*/ /***********************************************************************************/ /***********************************************************************************/ Route::group(['middleware' => ['admin']], function () { Route::resource('admin/process', 'Admin\\ProcessController'); Route::resource('admin/process', 'Admin\\ProcessController'); Route::resource('admin/task', 'Admin\\TaskController'); // Route::resource('admin/pivotextrafield', 'Admin\\PivotExtraFieldController'); Route::resource('admin/process', 'Admin\\ProcessController'); }); //api for CRUD & vue Route::get('api/facture/', function () { return Facture::orderBy('id', 'desc')->get(); }); Route::post('api/facture/create', function () { return Facture::create(Request::all()); }); Route::put('api/facture/{facture}', function (Facture $facture) { if ($facture->update(Request::all())) { return 'ok'; } }); Route::delete('api/facture/{facture}', function (Facture $facture) { // http://organit.app/api/table/1/factures $facture->delete(); }); Route::get('admin/generate_seeder', function (App\Table $table) { $schema = \DB::getDoctrineSchemaManager(); $tables = $schema->listTables(); foreach ($tables as $key => $table) { echo "/////";
/** * Remove the specified resource from storage. * * @param int $id * * @return Response */ public function destroy($id) { Facture::destroy($id); Session::flash('flash_message', 'Facture deleted!'); return redirect('admin/facture'); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { // $actif = 'gescom'; $profil = Facture::with('societedata', 'livraison', 'gescom')->findOrfail($id); foreach ($profil->modules as $key => $value) { $produit_id = $value->pivot->produit_id; } $produit = Produit::findOrFail($produit_id); $modules = $profil->modules; // foreach ($modules as $key => $value) { // var_dump($value->nom_module); // } // dd(); return view('gescom.detail-facture', compact('actif', 'profil', 'modules', 'produit')); }