TranceCode
TranceCode
Explore posts from servers
NNuxt
Created by TranceCode on 1/15/2025 in #❓・help
We don't have an Official Docker Image for NuxtJS?
I was searching in Docker hub but I see that there is no official image of NuxtJS, is this like that or have I searched wrong, can you please help me, thank you very much!
4 replies
FFilament
Created by TranceCode on 1/10/2025 in #❓┊help
It's possible make drag-and-drop with filament?
Hello friends, a question, is it possible to do drag-and-drop with Filament, to move to different positions, for example, images, texts, buttons, etc., this in a dashboard with Filament of course! As a separate topic, is it possible to do it with Livewire for the front of a site? I'm looking for some information on whether it is possible for both cases or would it be best to use JS in the front and dashboard for such a case? Thank you so much!
1 replies
FFilament
Created by TranceCode on 1/6/2025 in #❓┊help
How can edit the register account?
No description
9 replies
FFilament
Created by TranceCode on 12/30/2024 in #❓┊help
how can disable the createAction If?
I need to block the Create User button if the logged in user does not have an associated business, I want the button to be visible but when clicked it does not redirect and shows a Filament Notification, I tried this code but it does not work for me, it does not go through the validation, I tried with dd() but it still doesn't happen, is there something I'm forgetting or missing? This is my code!
<?php
namespace App\Filament\Resources\UserResource\Pages;

use App\Filament\Resources\UserResource;
use Filament\Actions;
use Filament\Actions\Action;
use Filament\Notifications\Notification;
use Filament\Resources\Pages\ListRecords;

class ListUsers extends ListRecords
{
protected static string $resource = UserResource::class;

protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make()
->before(function (Actions\CreateAction $action) {
// Validar si el usuario tiene negocios asociados
if ($this->shouldDisableCreate()) {
dd('hola');
Notification::make()
->warning()
->title('Acción no permitida')
->body('No puedes crear usuarios sin primero tener un negocio asociado.')
->persistent()
->actions([
Action::make('create')
->button()
->label('Crear usuario'),
])
->send();
// Detener la acción
$action->halt();
}
}),
];
}

private function shouldDisableCreate(): bool
{
return !auth()->user()->businesses()->exists();
}
}
<?php
namespace App\Filament\Resources\UserResource\Pages;

use App\Filament\Resources\UserResource;
use Filament\Actions;
use Filament\Actions\Action;
use Filament\Notifications\Notification;
use Filament\Resources\Pages\ListRecords;

class ListUsers extends ListRecords
{
protected static string $resource = UserResource::class;

protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make()
->before(function (Actions\CreateAction $action) {
// Validar si el usuario tiene negocios asociados
if ($this->shouldDisableCreate()) {
dd('hola');
Notification::make()
->warning()
->title('Acción no permitida')
->body('No puedes crear usuarios sin primero tener un negocio asociado.')
->persistent()
->actions([
Action::make('create')
->button()
->label('Crear usuario'),
])
->send();
// Detener la acción
$action->halt();
}
}),
];
}

private function shouldDisableCreate(): bool
{
return !auth()->user()->businesses()->exists();
}
}
3 replies
FFilament
Created by TranceCode on 12/18/2024 in #❓┊help
How can create and edit page using TinyEditor
No description
2 replies
FFilament
Created by TranceCode on 12/16/2024 in #❓┊help
How can integrate Socialite in Filament
No description
5 replies
FFilament
Created by TranceCode on 12/10/2024 in #❓┊help
How can show a modal message ?
Friends, how can I show a message in Modal here instead of a Notification?
Forms\Components\TextInput::make('email')
->email()
->required()
->unique(Guest::class, 'email', ignoreRecord: true)
->reactive()
->afterStateUpdated(function ($state, callable $set) {
$guest = Guest::where('email', $state)->first();
if($guest) {
$set('name', $guest->name);
$set('telephone', $guest->telephone);

// Show Modal here
\Filament\Notifications\Notification::make()
->title('¡Cuenta existente!')
->body('Esta cuenta ya está registrada en nuestro sistema.')
->seconds(5)
->danger()
->send();
}
})
->columnSpan(1),
Forms\Components\TextInput::make('email')
->email()
->required()
->unique(Guest::class, 'email', ignoreRecord: true)
->reactive()
->afterStateUpdated(function ($state, callable $set) {
$guest = Guest::where('email', $state)->first();
if($guest) {
$set('name', $guest->name);
$set('telephone', $guest->telephone);

// Show Modal here
\Filament\Notifications\Notification::make()
->title('¡Cuenta existente!')
->body('Esta cuenta ya está registrada en nuestro sistema.')
->seconds(5)
->danger()
->send();
}
})
->columnSpan(1),
My idea is to focus all the user's attention on the message that appears in the modal, i try with actions modal but is not working here! The message and Modal must be displayed in the context of creating a record
5 replies
FFilament
Created by TranceCode on 11/26/2024 in #❓┊help
How can show jason to html?
No description
3 replies
FFilament
Created by TranceCode on 11/26/2024 in #❓┊help
Display Notifications for different panels
No description
5 replies
FFilament
Created by TranceCode on 11/24/2024 in #❓┊help
Can't export data using ExportAction with Tenant
I'm trying to export data using Filament Export in my Tenant project, but when I try to export data it ends up giving me this error:
Base table or view not found: 1146 Table 'ffrankenphp.company_user' doesn't exist (Connection: mysql, SQL: select `companies`.*, `company_user`.`user_id` as `pivot_user_id`, `company_user`.`company_id` as `pivot_company_id` from `companies` inner join `company_user` on `companies`.`id` = `company_user`.`company_id` where `company_user`.`user_id` = 1 and `companies`.`deleted_at` is null) {"userId":1,"exception":"[object] (Illuminate\\Database\\QueryException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ffrankenphp.company_user' doesn't exist (Connection: mysql, SQL: select `companies`.*, `company_user`.`user_id` as `pivot_user_id`, `company_user`.`company_id` as `pivot_company_id` from `companies` inner join `company_user` on `companies`.`id` = `company_user`.`company_id` where `company_user`.`user_id` = 1 and `companies`.`deleted_at` is null) at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:825)
[stacktrace]
Base table or view not found: 1146 Table 'ffrankenphp.company_user' doesn't exist (Connection: mysql, SQL: select `companies`.*, `company_user`.`user_id` as `pivot_user_id`, `company_user`.`company_id` as `pivot_company_id` from `companies` inner join `company_user` on `companies`.`id` = `company_user`.`company_id` where `company_user`.`user_id` = 1 and `companies`.`deleted_at` is null) {"userId":1,"exception":"[object] (Illuminate\\Database\\QueryException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ffrankenphp.company_user' doesn't exist (Connection: mysql, SQL: select `companies`.*, `company_user`.`user_id` as `pivot_user_id`, `company_user`.`company_id` as `pivot_company_id` from `companies` inner join `company_user` on `companies`.`id` = `company_user`.`company_id` where `company_user`.`user_id` = 1 and `companies`.`deleted_at` is null) at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:825)
[stacktrace]
The issue is that this relationship is not what I use, the only relationship that exists between these 2 models is that commonarea belongs to companies, but here it tells me that it needs a
company_user
company_user
relationship, I have reviewed a little more and it seems to me that the export migrations when bringing
user_id
user_id
is causing me problems, I made the change to put it as
customer_id
customer_id
since customer is the user who is logged in and from his panel he can download the excel, but even so the problem is not solved... is there any idea that me give to solve this problem?
20 replies
FFilament
Created by TranceCode on 11/13/2024 in #❓┊help
Insert import and export button here!
No description
7 replies
FFilament
Created by TranceCode on 11/5/2024 in #❓┊help
How can add a new button in the login for different panel?
No description
10 replies
FFilament
Created by TranceCode on 10/12/2024 in #❓┊help
Help with TinyMCE, duplicate the textarea
No description
4 replies
FFilament
Created by TranceCode on 8/15/2024 in #❓┊help
how can disable days of week?
Hey friends, i need disable a days of week that i don-t have in the array in my table, i try whit this code but is not working, do you have any idea about how can fix this? i have this in my table row availabledays ["Lunes"] ["Sabado","Lunes","Jueves","Miercoles"] ["Miercoles","Lunes","Viernes","Sabado","Martes","Jueves","Domingo"] This is my code:
6 replies
FFilament
Created by TranceCode on 8/13/2024 in #❓┊help
How can I create a custom dashboard?
No description
4 replies
FFilament
Created by TranceCode on 8/4/2024 in #❓┊help
how can show information in topbar?
No description
3 replies
FFilament
Created by TranceCode on 7/30/2024 in #❓┊help
DatePicker type moth not working in Firefox and Safari
No description
3 replies
FFilament
Created by TranceCode on 7/28/2024 in #❓┊help
Multitenant with separated database?
Hello everyone, I want to ask a question, just out of curiosity to the filament team, have you ever thought about adding functionality to filament for tenants that can each work with their separate databases? 😃 Thank you so much!
6 replies
FFilament
Created by TranceCode on 7/3/2024 in #❓┊help
How can confirm or cancel the action in toggle
No description
7 replies
FFilament
Created by TranceCode on 7/2/2024 in #❓┊help
Hidden save and cancel button in form wizzard?
No description
6 replies