| 12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace App\Http\Livewire;
- use Livewire\Component;
- use Carbon\Carbon;
- class Dashboard extends Component
- {
- public $totMembers = 0;
- public $totSuppliers = 0;
- public $totTodayIn = 0;
- public $totTodayOut = 0;
- public $dayName;
- public function render()
- {
- return view('livewire.dashboard');
- }
- public function mount()
- {
- $this->dayName = Carbon::now()->locale('it_IT')->dayName;
- $this->totMembers = \App\Models\Member::count();
- $this->totSuppliers = \App\Models\Supplier::count();
- $this->totTodayIn = \App\Models\Record::where('type', 'IN')->where('date', date("Y-m-d"))->sum('amount');
- $this->totTodayOut = \App\Models\Record::where('type', 'OUT')->where('date', date("Y-m-d"))->sum('amount');
- }
- }
|