albertosemesale
albertosemesale
FFilament
Created by albertosemesale on 2/29/2024 in #❓┊help
How to create login sessions after admin login
Before incorporating Filament my current project had a Login method that created different session so that they'd be in use in the entire application
$request->session()->regenerate();
$userID = Auth::user()->id;
$user = User::find($userID);
// $role = $user->role;
$roles = $user->roles->pluck("name");
$permissions = $user->permissions;
$deptID = $user->deptID;
$name = Auth::user()->name." ".Auth::user()->last_name;

session(['rol' => $roles]);
session(['permissions' => $permissions]);
session(['id' => $userID]);
session(['departamento' => $deptID]);
session(['fullName' => $name]);
$request->session()->regenerate();
$userID = Auth::user()->id;
$user = User::find($userID);
// $role = $user->role;
$roles = $user->roles->pluck("name");
$permissions = $user->permissions;
$deptID = $user->deptID;
$name = Auth::user()->name." ".Auth::user()->last_name;

session(['rol' => $roles]);
session(['permissions' => $permissions]);
session(['id' => $userID]);
session(['departamento' => $deptID]);
session(['fullName' => $name]);
Naturally, filament has it's own admin Login, and by default, it lacks these features How would I recreate these sessions on Admin login?
3 replies
FFilament
Created by albertosemesale on 2/28/2024 in #❓┊help
Use value of another column in the same row in a custom table
I'm having difficulty having 2 tables, the first is supposed to retrieve whether the column "exit_date" has value or not, I can't use "exit_date" twice, it's one or the other The second I'm supposed to substract two dates (exit_date and enter_date) and obtain the remaining result.
return $table
->columns([
Tables\Columns\TextColumn::make('memo_number')->label("Numero de Memo"),
Tables\Columns\TextColumn::make('department.NombreDepartamento')->label("Departamento"),
Tables\Columns\TextColumn::make('address')->label("Dirección"),
Tables\Columns\TextColumn::make('sector')->label("Sector"),
Tables\Columns\TextColumn::make('enter_date')->label("Fecha de Inicio"),
Tables\Columns\TextColumn::make('exit_date')->label("Fecha de Fin"),


/* Tables\Columns\TextColumn::make('is_complete')->label("Completado")->description(function (request $record) {
return $record["exit_date"];
}),*/
Tables\Columns\TextColumn::make('is_complete')->label("Completado"),
Tables\Columns\TextColumn::make('reply_time')->label("Tiempo de respuesta"),




])
return $table
->columns([
Tables\Columns\TextColumn::make('memo_number')->label("Numero de Memo"),
Tables\Columns\TextColumn::make('department.NombreDepartamento')->label("Departamento"),
Tables\Columns\TextColumn::make('address')->label("Dirección"),
Tables\Columns\TextColumn::make('sector')->label("Sector"),
Tables\Columns\TextColumn::make('enter_date')->label("Fecha de Inicio"),
Tables\Columns\TextColumn::make('exit_date')->label("Fecha de Fin"),


/* Tables\Columns\TextColumn::make('is_complete')->label("Completado")->description(function (request $record) {
return $record["exit_date"];
}),*/
Tables\Columns\TextColumn::make('is_complete')->label("Completado"),
Tables\Columns\TextColumn::make('reply_time')->label("Tiempo de respuesta"),




])
5 replies
FFilament
Created by albertosemesale on 2/19/2024 in #❓┊help
Change custom widget's input value on load in laravel filament
No description
4 replies
FFilament
Created by albertosemesale on 2/14/2024 in #❓┊help
One datepicker filter for multiple chart widgets in Admin dashboard
How do I make one date picker to filter multiple chart widgets on the admin dashboard when the value changes? I'm using a custom Widget for the datepicker and would like to know what's the best practice for other widgets to interact after a DOM event is dispatched.
9 replies