public function adPreviousMonth($month) { $time = carbon::parse($month); $time = $time->subMonth(1); $clients = Client::orderBy('lastName', 'asc')->get(); return view('clients.index', compact('clients', 'time')); }
public function transformUser($user, $locale = 'ru') { return ['id' => $user->id, 'name' => $user->name, 'email' => $user->email, 'phone' => $this->transformPhone($user->phone), 'phones' => $this->transformPhones($user->phones->filter(function ($phone) use($user) { return $user->phone_id != $phone->id; })->values()), 'birthday' => $user->birthday, 'age' => Carbon::now()->diff(carbon::parse($user->birthday))->y, 'city' => $user->city, 'img' => ['thumb' => $user->img_small, 'middle' => $user->img_middle, 'origin' => $user->img_large], 'sex' => $user->sex, 'about' => $user->about, 'completed' => $user->completed, 'cars' => $this->transformcars($user->cars->filter(function ($car) use($user) { return $user->car_id != $car->id; })->values()), 'updated_at' => $user->updated_at]; }
public function printAnnualReport($date) { $clients = Client::orderBy('lname', 'asc')->get(); $time = carbon::parse($date); $year = $time->year; return view('report.annual_report_view', compact('clients', 'year')); }