30 lines
582 B
PHP
30 lines
582 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\View\Components;
|
||
|
|
||
|
use App\Models\User;
|
||
|
use Closure;
|
||
|
use Illuminate\Contracts\View\View;
|
||
|
use Illuminate\View\Component;
|
||
|
|
||
|
class SelectDriver extends Component
|
||
|
{
|
||
|
public $users;
|
||
|
|
||
|
/**
|
||
|
* Create a new component instance.
|
||
|
*/
|
||
|
public function __construct()
|
||
|
{
|
||
|
$this->users = User::where('warehouse_id', auth()->user()->warehouse_id)->get();
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Get the view / contents that represent the component.
|
||
|
*/
|
||
|
public function render(): View|Closure|string
|
||
|
{
|
||
|
return view('components.select-driver');
|
||
|
}
|
||
|
}
|