-
app/Models/User.php
Open in GitHubuse Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable { // const Admin = 1; const Manager = 2; const Teacher = 3; const Normal = 4; // }
-
app/Excel/Exports/UsersExport.php
Open in GitHubuse App\Models\User; use Illuminate\Contracts\View\View; use Maatwebsite\Excel\Concerns\FromView; class UsersExport implements FromView { public function view(): View { return view('exports.users', [ 'users' => User::where('type', User::Normal)->with('info')->whereRelation('info','companyId',companyId())->get() ]); } }