Skip to content

Instantly share code, notes, and snippets.

@jongravois
Created July 27, 2020 09:20
Show Gist options
  • Save jongravois/99a9f24e005ec4797d0730860da0574d to your computer and use it in GitHub Desktop.
Save jongravois/99a9f24e005ec4797d0730860da0574d to your computer and use it in GitHub Desktop.
<?php
namespace App\Http\Livewire\Levo;
use App\Models\Invoice;
use Livewire\Component;
class InvoicesManager extends Component
{
public $showTable = false;
public $start;
public $end;
public $sales = 'all';
public $salesTeam = [];
public function mount()
{
$this->start = now()->firstOfYear()->format('Y-m-d');
$this->end = now()->format('Y-m-d');
$this->salesTeam = Invoice::select('salesperson_code')
->orderBy('salesperson_code')
->get()
->pluck('salesperson_code')
->unique()
->toArray();
} // end function
public function render()
{
return view('livewire.levo.invoices-manager');
} // end function
public function updatedStart()
{
//dd($this->start);
$this->render();
} // end function
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment