public function backup() { $agendas = Agenda::whereHas('os', function ($q) { $q->where('status', 'concluido'); })->active()->where('data', '>', new Carbon('6 months ago'))->orderBy('data', 'DESC')->get(); return view('relatorios.backup', compact('agendas')); }
public function showAgenda($slug) { $data['menuse'] = Menu::orderBy('id')->get()->keyBy('id'); $data['agenda5'] = Agenda::orderBy('id', 'desc')->take(4)->get(); $data['footers'] = Footer::orderBy('id')->get()->keyBy('id'); $data['post'] = Agenda::where('slug', '=', $slug)->firstOrFail(); return view('agenda.showAgenda')->with('data', $data); }
/** * Bootstrap the application services. * * @return void */ public function boot() { Preco::saving(function ($preco) { $preco->filial_id = Auth::user()->funcionario->filial->id; }); Cliente::saving(function ($cliente) { $cliente->filial_id = Auth::user()->funcionario->filial->id; }); Agenda::saving(function ($agenda) { $agenda->filial_id = Auth::user()->funcionario->filial->id; }); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $this->authorize('coordenador'); $agendas = Agenda::getActiveAgenda(); return view('operacional.os.index', compact('agendas')); }
public function destroy($id) { $agenda = Agenda::findOrFail($id); $agenda->delete(); }
/** * Remove the specified resource from storage. * * @param Agenda $agenda * @return \Illuminate\Http\Response */ public function destroy(Agenda $agenda) { $agenda->os()->delete(); $agenda->delete(); return redirect()->action('AgendaController@index'); }
public function visi() { $data['menuse'] = Menu::orderBy('id')->get()->keyBy('id'); $data['agenda5'] = Agenda::orderBy('id', 'desc')->take(4)->get(); $data['footers'] = Footer::orderBy('id')->get()->keyBy('id'); $data['berita-footer'] = Berita::orderBy('id', 'desc')->take(9)->get(); $data['tentang-unit'] = AdminTentang::orderBy('id')->get()->keyBy('id'); return view('visi')->with('data', $data); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $agendas = Agenda::getActiveAgenda(); return view('operacional.processos.index', compact('agendas')); }
Route::post('login', 'LoginLogoutController@login'); Route::get('logout', 'LoginLogoutController@logout'); Route::get('checklogin', 'LoginLogoutController@checkLogin'); // Users resource API Route::get('users', 'UsersController@index'); Route::post('users', 'UsersController@store'); Route::get('users/{id}', 'UsersController@show'); Route::put('users/{id}', 'UsersController@update'); Route::delete('users/{id}', 'UsersController@destroy'); // Agendas resource API Route::get('agendas', 'AgendasController@index'); Route::post('agendas', 'AgendasController@store'); Route::get('agendas/{id}', 'AgendasController@show'); Route::put('agendas/{id}', 'AgendasController@update'); Route::delete('agendas/{id}', 'AgendasController@destroy'); // Activities resource API Route::get('activities', 'ActivitiesController@index'); Route::post('activities', 'ActivitiesController@store'); Route::get('activities/{id}', 'ActivitiesController@show'); Route::put('activities/{id}', 'ActivitiesController@update'); Route::delete('activities/{id}', 'ActivitiesController@destroy'); // Many-to-many relational resource for agendas Route::get('agendas/{id}/users', function ($id) { return Agenda::find($id)->users()->get(); }); // Many-to-many relational resource for users Route::get('users/{id}/agendas', function ($id) { return User::find($id)->agendas()->get(); }); }); });
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $agenda = Agenda::find($id); $agenda->delete(); return response()->json(["pesan" => "dell"]); }