Build a tax dropdown for further usage.
This commit is contained in:
16
app/View/Composers/TaxDropdown.php
Normal file
16
app/View/Composers/TaxDropdown.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Composers;
|
||||
|
||||
use App\Models\Taxrate;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class TaxDropdown
|
||||
{
|
||||
public function compose(View $view): void
|
||||
{
|
||||
$standard = Taxrate::where('active', true)->first();
|
||||
|
||||
$view->with(['tax_rates' => TaxRate::all(), 'standard' => $standard->rate]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user