/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $itbi = Itbi::find($id); $cheque = Cheque::where('cheques.processo', $itbi->processo)->get(); $deposito = Deposito::where('depositos.processo', $itbi->processo)->get(); return compact('itbi', 'cheque', 'deposito'); }
/** * Execute the console command. * * @return mixed */ public function handle() { $getCheques = Cheque::whereRaw("cheques.ispredated = 1 AND DATE(cheques.predated) = CURDATE() AND cheques.status_id = 4")->get(); foreach ($getCheques as $cheque) { Cheque::where('cheques.id', $cheque->id)->update(['cheques.status_id' => 1]); } Log::info(count($getCheques) . " Cheques foram mudados de status de pré-datado para depositar em" . date("d/m/Y")); $this->info("Cheques foram alterados com sucesso."); }