ghot83
ghot83
FFilament
Created by ghot83 on 4/29/2024 in #❓┊help
Is it possible to create this function in CustomerResource.php?
Hello everyone, good morning, it is possible at CostumerResource.php create a function to check if the customer is already registered with the same cnpj, stop the creation function and show the notification to him, please help me how should I do this. would it be like this? public static function save() { $cnpj = request()->input('cnpj'); // Checks if there is already a Customer with the same CNPJ if (Customer::where('cnpj', $cnpj)->exists()) { // Returns an error message indicating that the CNPJ already exists Notification::make() ->title('') ->body('') ->warning() ->send() } // If it does not exist, continue with the save operation return parent::save(); }
3 replies
FFilament
Created by ghot83 on 4/27/2024 in #❓┊help
Tabs/Costumer/installments
Hi team, I have doubts as to whether it is possible to show a list in the customer's installments tab. This tab must contain a list of all the customer's installments, generated from finance, can someone help me, please! Thank you very much in advance.
4 replies