bakriawad
bakriawad
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
I will try that
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
am I missing a config or something??
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
there is a mount and change tab function, neither should have any effect
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
this is basically the whole thing..
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
<?php

namespace App\Filament\Pages;


use App\Services\MessageService;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Pages\Actions\Action;
use Filament\Pages\Page;

class Patient extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-document-text';
protected static string $view = 'filament.pages.patient';
protected static ?string $title = 'Patient profile';
protected static ?string $slug = 'patient/{patientId}/{currentTab?}';
public $patientId;
public $patient;
public $tabs = [];
public $currentTab = 'tab1';
public $subTab = 'subTab1';


protected function getHeaderActions(): array
{
return [
Action::make('Message')
->action(function ($data): void {
dd($data);

$message = [
'from_user_id' => auth()->user()->id,
'to_user_id' => $this->patient->user->id,
'type' => 'patient',
'subject' => $data['subject'],
'message' => $data['message'],
'created_at' => now(),
];

MessageService::createMessages([$message]);
})->icon('heroicon-o-envelope')->label('Message')->modalButton('Send Message')->modalHeading(request()->input('id'))
->form([
TextInput::make('to')->default($this->patient->user->name.' ('.$this->patient->user->email.')')->disabled(),
TextInput::make('subject')->required(),
Textarea::make('message')->required(),
FileUpload::make('files')->label('Attachments')->disk('local')
]),
];
}



public function getTitle(): string
{
return "Test Page";
}
<?php

namespace App\Filament\Pages;


use App\Services\MessageService;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Pages\Actions\Action;
use Filament\Pages\Page;

class Patient extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-document-text';
protected static string $view = 'filament.pages.patient';
protected static ?string $title = 'Patient profile';
protected static ?string $slug = 'patient/{patientId}/{currentTab?}';
public $patientId;
public $patient;
public $tabs = [];
public $currentTab = 'tab1';
public $subTab = 'subTab1';


protected function getHeaderActions(): array
{
return [
Action::make('Message')
->action(function ($data): void {
dd($data);

$message = [
'from_user_id' => auth()->user()->id,
'to_user_id' => $this->patient->user->id,
'type' => 'patient',
'subject' => $data['subject'],
'message' => $data['message'],
'created_at' => now(),
];

MessageService::createMessages([$message]);
})->icon('heroicon-o-envelope')->label('Message')->modalButton('Send Message')->modalHeading(request()->input('id'))
->form([
TextInput::make('to')->default($this->patient->user->name.' ('.$this->patient->user->email.')')->disabled(),
TextInput::make('subject')->required(),
Textarea::make('message')->required(),
FileUpload::make('files')->label('Attachments')->disk('local')
]),
];
}



public function getTitle(): string
{
return "Test Page";
}
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
No description
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
No description
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
No description
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
Livewire component sitting in a filament page
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
On a page
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
I tried that before, didn't work. Let me try
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
I need to upload files from here, and capture it, but the files aren't captured. the messages are created, this whole code works... just that the file upload doesn't
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
Action::make('Message')
->action(function ($data): void {
dd($data);

$message = [
'from_user_id' => auth()->user()->id,
'to_user_id' => $this->patient->user->id,
'type' => 'patient',
'subject' => $data['subject'],
'message' => $data['message'],
'created_at' => now(),
];

MessageService::createMessages([$message]);
})->icon('heroicon-o-envelope')->label('Message')->modalButton('Send Message')->modalHeading(request()->input('id'))
->form([
TextInput::make('to')->default($this->patient->user->name.' ('.$this->patient->user->email.')')->disabled(),
TextInput::make('subject')->required(),
Textarea::make('message')->required(),
FileUpload::make('files')->label('Attachments')->disk('local')
->directory(fn ($record) => 'message_attachments/'.$record->id)->visibility('private')->multiple()
->preserveFilenames()->dehydrated()
]),
Action::make('Message')
->action(function ($data): void {
dd($data);

$message = [
'from_user_id' => auth()->user()->id,
'to_user_id' => $this->patient->user->id,
'type' => 'patient',
'subject' => $data['subject'],
'message' => $data['message'],
'created_at' => now(),
];

MessageService::createMessages([$message]);
})->icon('heroicon-o-envelope')->label('Message')->modalButton('Send Message')->modalHeading(request()->input('id'))
->form([
TextInput::make('to')->default($this->patient->user->name.' ('.$this->patient->user->email.')')->disabled(),
TextInput::make('subject')->required(),
Textarea::make('message')->required(),
FileUpload::make('files')->label('Attachments')->disk('local')
->directory(fn ($record) => 'message_attachments/'.$record->id)->visibility('private')->multiple()
->preserveFilenames()->dehydrated()
]),
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
Action::make('Message')
->action(function ($data): void {
dd($data);
...
})->icon('heroicon-o-envelope')->label('Message')->modalButton('Send Message')->modalHeading(request()->input('id'))
->form([
...
Action::make('Message')
->action(function ($data): void {
dd($data);
...
})->icon('heroicon-o-envelope')->label('Message')->modalButton('Send Message')->modalHeading(request()->input('id'))
->form([
...
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
the form is on a button, executed on click, and is a page Action
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
the files are selected then uplaoded via the FileUpload form component
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
uploading new files, attachments to an email/message I am unsure where they should save, searched PC for the files but nothing appears
29 replies
FFilament
Created by bakriawad on 2/6/2024 in #❓┊help
File upload not returning url after upload
Didn't work, still empty array is returned
29 replies
FFilament
Created by bakriawad on 1/17/2024 in #❓┊help
Filament Action in livewire component failing in a weird circumstance
I still can't figure this out. The action just calls the database, can't find the right function to override to stop this, no options I found to disable this. I can't use this action at all right now, and it's frustrating. No documentation or mentions of this at all
2 replies
FFilament
Created by bakriawad on 1/6/2024 in #❓┊help
some Tailwind classes not working
Thanks a lot!
31 replies