Gianmarco Varrone
Is there a way to build and admin panel exclusively consuming an external API?
I already built the admin panel of my project using filament. I have also built some Api to consume, now I need to create a client app which Is another admin panel but for a completely different kind of user which consumes these Api and I was looking around if It is possible to do something similar using filament.
4 replies
Form field not updating with reactive()
Hello everybody, I built the following form and I need that when the user sets "turn_on_opening" to true, the turn_on_at field takes the value of the shop_opening_time. The callback is working but the data is not put inside the field. How can I solve this issue?Thank you...
5 replies
Editing multiple images
Hello, in my admin Panel I have model PointOfSale with the related CreatePointOfSalePage. Also, i have another model called PosImage . Between the pointOfSale model and the PosImage there's an hasMany relation called pictures().
In the create page I have adde a file upload field that correctly uploads each picture to digital ocean spaces.
10 replies
How to get the current record in lifecycle hook after() method on pop up
I'm having a issue in getting the current record in the after() method of a pop up, I thought to be able to access the current record with $this->record like in the afterCreate() method but it keeps returning null on $this->record. I can only acces the form data which of curseare not including the id of the current record that I need. Any suggestion on how to do so? Thank you in advance
11 replies
Prevent user from viewing a resource
Hello, I would like to prevent users, based on their role, to access specific resources (Example: If user isn't admin he can't see the user resources at all). I was able to conditionally hide the navigation label, but of course the url is still accessible.
8 replies
Multiple forms on custom page
Hello, is there any way I can add multiple forms to a custom page? I the
getFormSchema()
method in my component that is already creating up a form but I need to add one more form for a different action.39 replies
Dynamic page title throws error
Hello, I'm trying to set a dynamic page title. Unfortunately when the mount method executes it throws an error related to the getRecord() method.
<?php
namespace App\Filament\Resources\TicketResource\Pages;
use App\Models\Ticket;
use Filament\Pages\Actions;
use Filament\Resources\Pages\ViewRecord;
use App\Filament\Resources\TicketResource;
class ViewTicket extends ViewRecord
{
protected static string $resource = TicketResource::class;
protected static string $view = 'filament.resources.tickets.pages.view-ticket';
protected static ?string $title = 'Ticket n.' ;
public function mount($record): void
{
$ticket = Ticket::find($record);
$this->number = $ticket->number;
// Imposta il titolo dinamicamente
ViewTicket::$title = "Ticket n.{$this->number}";
}
protected function getActions(): array
{
return [
//
];
}
}
This is the code that I'm using and this is the error that I'm getting but I don't understand why, the error in my opinion comes from ($ticket=Ticket::find($record)): Filament\Resources\Pages\ViewRecord::getRecord(): Return value must be of type Illuminate\Database\Eloquent\Model, string returned13 replies
Using custom colors
I've successfully built tailwind with vite, created a new tailwind.config file to override the default colors and everything seems to work. The issue I'm having is that, if in the tailwind.config i add new colors beside the primary, success ecc. let's say Violet, this color is not rendered from filament. How do i
solve this?
21 replies
Getting Url of Resource View Page
Hello, I think this really a stupid question but is one hour that I'm hitting my head over it and I did not find any solution in the docs. I want a table ViewAction to redirect to the view page of the rosurce but, hoe do i get the route of the page? I'have tried everything but I keep getting errors
23 replies
How to create custom actions and show them in custom views?
Hello, I've created a custom component for a custom view page where I want to show all the help tickets related to the current booking. I've successfully shown the records needed but I would also like to display a button in this component where it's possible to create a new ticket for that booking. I thought to do it using actions, but I can't understand how to build a custom action and how I can show it in a custom view. Thank you very much in advance for your help
103 replies