MarconiMamba
MarconiMamba
FFilament
Created by MarconiMamba on 10/13/2023 in #❓┊help
Admins access all tenants
Negative. Just been attaching my admin user to the tenants I wish to access.
3 replies
FFilament
Created by MarconiMamba on 11/2/2023 in #❓┊help
Only allow clipboard pasting, not typing, into a field.
I'm having a lot of trouble getting the content of the File i'm uploading. I've tried
$xml = simplexml_load_string(file_get_contents($state));
-- file_get_contents(C:\[obfuscated]\Temp\php96E.tmp): Failed to open stream: No such file or directory
$xml = simplexml_load_string(file_get_contents($state));
-- file_get_contents(C:\[obfuscated]\Temp\php96E.tmp): Failed to open stream: No such file or directory
$xml = simplexml_load_string(file_get_contents($state->realPath));
-- Undefined property: Livewire\Features\SupportFileUploads\TemporaryUploadedFile::$realPath
$xml = simplexml_load_string(file_get_contents($state->realPath));
-- Undefined property: Livewire\Features\SupportFileUploads\TemporaryUploadedFile::$realPath
$xml = simplexml_load_string(file_get_contents($state->file->getFilename()));
$xml = simplexml_load_string(file_get_contents($state->file->getFilename()));
$xml = simplexml_load_string(file_get_contents($state->file->getFilename()));
$xml = simplexml_load_string(file_get_contents($state->file->getFilename()));
both with similar results the ddd of $state shows me the actual path for the file as realPath
Livewire\Features\SupportFileUploads\TemporaryUploadedFile {#2038 ▼ // vendor\spatie\laravel-ignition\src\helpers.php:14
-test: false
-originalName: "Hqwv9i9GqU19a61jnEueuUnsSbxoxF-metaQVRNRU5VLnVudXNlZFRpY2tldE92ZXJyaWRlLnhtbA==-.txt"
-mimeType: "application/octet-stream"
-error: 0
#hashName: null
#disk: "local"
#storage: Illuminate\Filesystem\FilesystemAdapter {#2028 ▶}
#path: "livewire-tmp/Hqwv9i9GqU19a61jnEueuUnsSbxoxF-metaQVRNRU5VLnVudXNlZFRpY2tldE92ZXJyaWRlLnhtbA==-.txt"
path: "D:\[obfuscated]\storage\app\livewire-tmp"
filename: "Hqwv9i9GqU19a61jnEueuUnsSbxoxF-metaQVRNRU5VLnVudXNlZFRpY2tldE92ZXJyaWRlLnhtbA==-.txt"
basename: "php7F25.tmp"
pathname: "C:\[obfuscated\Temp\php7F25.tmp"
extension: "tmp"
realPath: "D:[obfuscated]\storage\app\livewire-tmp/Hqwv9i9GqU19a61jnEueuUnsSbxoxF-metaQVRNRU5VLnVudXNlZFRpY2tldE92ZXJyaWRlLnhtbA==-.txt"
aTime: 2023-11-02 21:24:08
mTime: 2023-11-02 21:24:08
cTime: 2023-11-02 21:24:08
inode: 737182964005292854
size: 154
writable: false
readable: false
executable: false
file: false
dir: false
link: false
}
Livewire\Features\SupportFileUploads\TemporaryUploadedFile {#2038 ▼ // vendor\spatie\laravel-ignition\src\helpers.php:14
-test: false
-originalName: "Hqwv9i9GqU19a61jnEueuUnsSbxoxF-metaQVRNRU5VLnVudXNlZFRpY2tldE92ZXJyaWRlLnhtbA==-.txt"
-mimeType: "application/octet-stream"
-error: 0
#hashName: null
#disk: "local"
#storage: Illuminate\Filesystem\FilesystemAdapter {#2028 ▶}
#path: "livewire-tmp/Hqwv9i9GqU19a61jnEueuUnsSbxoxF-metaQVRNRU5VLnVudXNlZFRpY2tldE92ZXJyaWRlLnhtbA==-.txt"
path: "D:\[obfuscated]\storage\app\livewire-tmp"
filename: "Hqwv9i9GqU19a61jnEueuUnsSbxoxF-metaQVRNRU5VLnVudXNlZFRpY2tldE92ZXJyaWRlLnhtbA==-.txt"
basename: "php7F25.tmp"
pathname: "C:\[obfuscated\Temp\php7F25.tmp"
extension: "tmp"
realPath: "D:[obfuscated]\storage\app\livewire-tmp/Hqwv9i9GqU19a61jnEueuUnsSbxoxF-metaQVRNRU5VLnVudXNlZFRpY2tldE92ZXJyaWRlLnhtbA==-.txt"
aTime: 2023-11-02 21:24:08
mTime: 2023-11-02 21:24:08
cTime: 2023-11-02 21:24:08
inode: 737182964005292854
size: 154
writable: false
readable: false
executable: false
file: false
dir: false
link: false
}
11 replies
FFilament
Created by MarconiMamba on 11/2/2023 in #❓┊help
Only allow clipboard pasting, not typing, into a field.
Last question for now. If I don't want the file itself stored or put into the database, is there anything special I need to do? Or if I just have the FileUpload::make('nonexistent_field') will that work?
11 replies
FFilament
Created by MarconiMamba on 11/2/2023 in #❓┊help
Only allow clipboard pasting, not typing, into a field.
I've used ->readOnly with fields to make them not editable but still insert into the DB fine. What do I pass into the function on afterStateUpdated on the file to get the contents? Does $state contain the file?
11 replies
FFilament
Created by MarconiMamba on 11/2/2023 in #❓┊help
Only allow clipboard pasting, not typing, into a field.
thinking about it more I much strongly prefer the file upload method if it's possible.
11 replies
FFilament
Created by MarconiMamba on 10/20/2023 in #❓┊help
Block DetachAction on some list items
->actions([
Tables\Actions\DetachAction::make()
->visible(fn (ButtonGroup $record): bool => $record->agency->name !== "ADMINISTRATION"),
])
->actions([
Tables\Actions\DetachAction::make()
->visible(fn (ButtonGroup $record): bool => $record->agency->name !== "ADMINISTRATION"),
])
6 replies
FFilament
Created by MarconiMamba on 10/20/2023 in #❓┊help
Block DetachAction on some list items
I was overthinking it. It's literally the same fn in the ->visible function.
6 replies
FFilament
Created by MarconiMamba on 10/20/2023 in #❓┊help
Block DetachAction on some list items
I am successfully using
->checkIfRecordIsSelectableUsing(fn (Model $record): bool => $record->agency->name !== "ADMINISTRATION")
->checkIfRecordIsSelectableUsing(fn (Model $record): bool => $record->agency->name !== "ADMINISTRATION")
to block bulk selection of the item, but I still have the detach button in the line.
6 replies
FFilament
Created by MarconiMamba on 10/19/2023 in #❓┊help
How to show more information in RelationManager Attach Search.
so here's a question because I apparently don't know how to use composer. my composer.json is set for filament to be
"filament/filament": "3.0.*",
"filament/filament": "3.0.*",
but when I run artisan filament:upgrade and then composer show filament/filament it says i'm still on 3.0.73. I don't know what i'm doing wrong.
> composer show filament/filament
name : filament/filament
descrip. : A collection of full-stack components for accelerated Laravel app development.
keywords :
versions : * v3.0.73
> composer show filament/filament
name : filament/filament
descrip. : A collection of full-stack components for accelerated Laravel app development.
keywords :
versions : * v3.0.73
10 replies
FFilament
Created by MarconiMamba on 10/12/2023 in #❓┊help
Setting a default value to another value from the table.
I tried installing that plugin before and got errors I didn't feel like troubleshooting at the time. it doesn't seem to work with my json require having filament requiring 3.0-stable
4 replies
FFilament
Created by MarconiMamba on 10/10/2023 in #❓┊help
Going deeper on Tenant relationships
I found this closed Issue (https://github.com/filamentphp/filament/issues/8468), which references the
\Znck\Eloquent\Relations\BelongsToThrough
\Znck\Eloquent\Relations\BelongsToThrough
. Looked it up and installed the
staudenmeir/belongs-to-through
staudenmeir/belongs-to-through
package. I have gotten past my errors.
16 replies
FFilament
Created by MarconiMamba on 10/10/2023 in #❓┊help
Going deeper on Tenant relationships
We're getting closer. I found HasManyThrough which I put on my Agency to have many Buttons through ButtonGroups. but I do not see anything like BelongsToThrough. I tried HasOneThrough, but that's backward since my ButtonGroups doesn't have a button_id column (since it's one to many in the other direction)
16 replies
FFilament
Created by MarconiMamba on 10/10/2023 in #❓┊help
Going deeper on Tenant relationships
So do I need to directly relate my Buttons to my Agencies with BelongsTo and HasMany? I can't do anything to automatically go through the middle relation? (ButtonGroup)
16 replies
FFilament
Created by MarconiMamba on 10/10/2023 in #❓┊help
Going deeper on Tenant relationships
I think i have gathered that that's where I was going wrong
16 replies
FFilament
Created by MarconiMamba on 10/10/2023 in #❓┊help
Going deeper on Tenant relationships
I'm trying something along these lines, but it isn't working:
public function agency(): BelongsTo
{
return $this->buttonGroup->agency();
}
public function agency(): BelongsTo
{
return $this->buttonGroup->agency();
}
16 replies
FFilament
Created by MarconiMamba on 10/10/2023 in #❓┊help
Going deeper on Tenant relationships
I did make a mistake in my original post and I did create
agency(): BelongsTo
agency(): BelongsTo
updated the origial question.
16 replies
FFilament
Created by MarconiMamba on 10/10/2023 in #❓┊help
Going deeper on Tenant relationships
the "Button" model is equivalent to a post in this instance. It's named Button since I'm writing this webapp as a supplemental tool for another product, and that's what the other tool calls this piece.
16 replies
FFilament
Created by MarconiMamba on 10/10/2023 in #❓┊help
Going deeper on Tenant relationships
for clarity. I've created the resource, just when I click on it to go to the list in my panel, I get the above error message.
16 replies