F
Filament12mo ago
vas

Stancl/Tenancy Filament 3

hi i have setup Stancl/Tenancy and its working fine , but i cant get filament to work on tenants subdomain it does load part of the page in the bg but then i get this error
Solution:
```php public function boot(): void { // ... ...
Jump to solution
138 Replies
vas
vasOP12mo ago
->middleware([
InitializeTenancyBySubdomain::class,
->middleware([
InitializeTenancyBySubdomain::class,
added this obviously is trying to access the central domains users db am i missing something thanks
vas
vasOP12mo ago
No description
Dennis Koch
Dennis Koch12mo ago
Which one is your central domain and which one the subdomain?
vas
vasOP12mo ago
localhost is my central apex.localhost is my sub i don't have an users table in my central migrations when registering a tenant i create an user inside tenants db so from what i can tell is looking for the users table in the central domain db instead of the tenants db @Dennis Koch ? anyone ? seems to work for some part
vas
vasOP12mo ago
Dennis Koch
Dennis Koch12mo ago
So only the dashboard is an issue? Weird.
vas
vasOP12mo ago
well not really , when i click create on anything its pops same error i have nailed it v2 docs say stancl/tenancy To set up stancl/tenancy to work with Filament, you just need to add the InitializeTenancyByDomain::class middleware to Livewire and the Filament config file: use Stancl\Tenancy\Middleware\InitializeTenancyByDomain; 'middleware' => [ // ... 'base' => [ // ... InitializeTenancyByDomain::class ], ], In Livewire 3, the configuration key middleware_group has been removed, so instead add the following in TenancyServiceProvider (or any other provider):
Solution
vas
vas12mo ago
public function boot(): void
{
// ...

Livewire::setUpdateRoute(function ($handle) {
return Route::post('/livewire/update', $handle)
->middleware(
'web',
'universal',
InitializeTenancyByDomain::class, // or whatever tenancy middleware you use
);
});
}
public function boot(): void
{
// ...

Livewire::setUpdateRoute(function ($handle) {
return Route::post('/livewire/update', $handle)
->middleware(
'web',
'universal',
InitializeTenancyByDomain::class, // or whatever tenancy middleware you use
);
});
}
vas
vasOP12mo ago
@Dennis Koch i now have the same issue when using the fileupload
vas
vasOP12mo ago
No description
vas
vasOP12mo ago
No description
vas
vasOP12mo ago
No description
vas
vasOP12mo ago
any idea how to fix this
Dennis Koch
Dennis Koch12mo ago
Since it’s a Livewire request that should be handled by the Livewire middleware you already set up 🤔
vas
vasOP12mo ago
That’s what I thinking But that’s for the livewire/update I tried /livewire only but still same any idea
Dennis Koch
Dennis Koch12mo ago
Nope. Sorry.
vas
vasOP12mo ago
k @Dennis Kochnailed it
'temporary_file_upload' => [
'disk' => null, // Example: 'local', 's3' | Default: 'default'
'rules' => 'max:200000', // Example: ['file', 'mimes:png,jpg'] | Default: ['required', 'file', 'max:12288'] (12MB)
'directory' => null, // Example: 'tmp' | Default: 'livewire-tmp'
'middleware' => \Stancl\Tenancy\Middleware\InitializeTenancyByDomainOrSubdomain::class, // Example: 'throttle:5,1' | Default: 'throttle:60,1'
'preview_mimes' => [ // Supported file types for temporary pre-signed file URLs...
'png', 'gif', 'bmp', 'svg', 'wav', 'mp4',
'mov', 'avi', 'wmv', 'mp3', 'm4a',
'jpg', 'jpeg', 'mpga', 'webp', 'wma',
],
'max_upload_time' => 5, // Max duration (in minutes) before an upload is invalidated...
],
'temporary_file_upload' => [
'disk' => null, // Example: 'local', 's3' | Default: 'default'
'rules' => 'max:200000', // Example: ['file', 'mimes:png,jpg'] | Default: ['required', 'file', 'max:12288'] (12MB)
'directory' => null, // Example: 'tmp' | Default: 'livewire-tmp'
'middleware' => \Stancl\Tenancy\Middleware\InitializeTenancyByDomainOrSubdomain::class, // Example: 'throttle:5,1' | Default: 'throttle:60,1'
'preview_mimes' => [ // Supported file types for temporary pre-signed file URLs...
'png', 'gif', 'bmp', 'svg', 'wav', 'mp4',
'mov', 'avi', 'wmv', 'mp3', 'm4a',
'jpg', 'jpeg', 'mpga', 'webp', 'wma',
],
'max_upload_time' => 5, // Max duration (in minutes) before an upload is invalidated...
],
the issue i have now is this
vas
vasOP12mo ago
No description
vas
vasOP12mo ago
No description
vas
vasOP12mo ago
as you can see its trying to fetch the image from the wrong path How can I modify the url @Dan Harrin any idea
Dan Harrin
Dan Harrin12mo ago
#✅┊rules
vas
vasOP12mo ago
K Thought you could help sorry for tagging would really appreciate any help on this
Dan Harrin
Dan Harrin12mo ago
at this point, it's probably a livewire-stancl issue rather than anything to do with Filament.
vas
vasOP12mo ago
You probably are right I tend to think more of livewire Because setting the stancl middleware for the temp dir in livewire cgf sorted the issue with the upload But there is no setting for anything else
MRST0RM
MRST0RM12mo ago
Did you check if the Filesystem tenancy bootstrapper is setted? https://tenancyforlaravel.com/docs/v3/tenancy-bootstrappers/
Tenancy for Laravel
Tenancy bootstrappers | Tenancy for Laravel
Tenancy bootstrappers | Tenancy for Laravel
MRST0RM
MRST0RM12mo ago
in the same file I put this too: 'middleware_group' => [ 'web', 'universal', InitializeTenancyBySubdomain::class, ],
vas
vasOP12mo ago
like additional to the actual middleware ? i haven't checked this yet Filesystem tenancy bootstrapper is set
'bootstrappers' => [
Stancl\Tenancy\Bootstrappers\DatabaseTenancyBootstrapper::class,
Stancl\Tenancy\Bootstrappers\CacheTenancyBootstrapper::class,
Stancl\Tenancy\Bootstrappers\FilesystemTenancyBootstrapper::class,
Stancl\Tenancy\Bootstrappers\QueueTenancyBootstrapper::class,
// Stancl\Tenancy\Bootstrappers\RedisTenancyBootstrapper::class, // Note: phpredis is needed
],
'bootstrappers' => [
Stancl\Tenancy\Bootstrappers\DatabaseTenancyBootstrapper::class,
Stancl\Tenancy\Bootstrappers\CacheTenancyBootstrapper::class,
Stancl\Tenancy\Bootstrappers\FilesystemTenancyBootstrapper::class,
Stancl\Tenancy\Bootstrappers\QueueTenancyBootstrapper::class,
// Stancl\Tenancy\Bootstrappers\RedisTenancyBootstrapper::class, // Note: phpredis is needed
],
Dennis Koch
Dennis Koch12mo ago
I don’t know what’s the best way with the current version. With the alpha there is a command to symlink the tenants public folders as public-1 etc. This is what you need and also you need to adjust the URLs for the new public symlinks. I think that was more work in the current version that’s why I sponsored for the alpha
vas
vasOP12mo ago
I found this post with pretty much the exact same issues https://discord.com/channels/883083792112300104/1140292180745924618 I wonder if anyone there got this working Everything else works fine
Dennis Koch
Dennis Koch12mo ago
How is this related? The other post is about assets, your issue is the public storage folder.
vas
vasOP12mo ago
well its the same maybe its worded wrong by me on the tenant app i get the assets using tenant_asset() i need a way to do that for filament now @Dennis Koch i have Disabled tenant asset helper: 'config.tenancy.filesystem.asset_helper_tenancy' => false,
Dennis Koch
Dennis Koch12mo ago
Your assets seem to load fine? Otherwise CSS and JS wouldn't work, right?
vas
vasOP12mo ago
i have done all the steps you laid out here https://discord.com/channels/883083792112300104/1140292180745924618/1142012944750759936 for any assets i use tenant_asset()
Dennis Koch
Dennis Koch12mo ago
Can you shortly explain again what your current issue is? What part it not working?
vas
vasOP12mo ago
so after using the image upload in filament file gets uploaded fine in its tenant dir
Dennis Koch
Dennis Koch12mo ago
Okay, so it's about public storage as I thought. Not about assets
vas
vasOP12mo ago
No description
vas
vasOP12mo ago
<img src="{{ tenant_asset($item->image )}}">
<img src="{{ tenant_asset($item->image )}}">
i get that file like this fine
Dennis Koch
Dennis Koch12mo ago
I think you need this + manually symlinking public folders. https://tenancyforlaravel.com/docs/v3/tenancy-bootstrappers/#storage-facade
Tenancy for Laravel
Tenancy bootstrappers | Tenancy for Laravel
Tenancy bootstrappers | Tenancy for Laravel
Dennis Koch
Dennis Koch12mo ago
asset() is not meant for accessing storage.
vas
vasOP12mo ago
only issue in filament its that the image its not being resolved properly
vas
vasOP12mo ago
No description
vas
vasOP12mo ago
No description
vas
vasOP12mo ago
it should be vas.localhost/
Dennis Koch
Dennis Koch12mo ago
Yes, I understand. It's pointing to storage/ which is the central domain.
it should be vas.localhost/
No, that wouldn't help as public/storage is a symlink to storage/app/public, also the subdomains would link there. Did you check the link to the docs I sent?
vas
vasOP12mo ago
yea i went over that all day yesterday i done it i have this
public function boot()
{
// Update the middleware used by the asset controller
TenantAssetsController::$tenancyMiddleware = InitializeTenancyByDomainOrSubdomain::class;
}
public function boot()
{
// Update the middleware used by the asset controller
TenantAssetsController::$tenancyMiddleware = InitializeTenancyByDomainOrSubdomain::class;
}
Dennis Koch
Dennis Koch12mo ago
Can you show the root_override part of config/tenancy.php ? And the code for your ImageColumn
vas
vasOP12mo ago
'root_override' => [
// Disks whose roots should be overridden after storage_path() is suffixed.
'local' => '%storage_path%/app/',
'public' => '%storage_path%/app/public/',
],
'root_override' => [
// Disks whose roots should be overridden after storage_path() is suffixed.
'local' => '%storage_path%/app/',
'public' => '%storage_path%/app/public/',
],
Tables\Columns\ImageColumn::make('image'),
Tables\Columns\ImageColumn::make('image'),
Dennis Koch
Dennis Koch12mo ago
You should specify the disk. ->disk('public') is probably what you want. Or are the files private?
vas
vasOP12mo ago
they are not private
Tables\Columns\ImageColumn::make('image')->disk('public'),
Tables\Columns\ImageColumn::make('image')->disk('public'),
same , i think public is the default
Dennis Koch
Dennis Koch12mo ago
Exactly same URL? What does Storage::disk('public')->url('test') return inside Filament?
vas
vasOP12mo ago
same url yest
"http://localhost/storage/test" // app\Filament\Resources\ShopItemResource.php:63
"http://localhost/storage/test" // app\Filament\Resources\ShopItemResource.php:63
i done a dump in the Resource file , is that what you meant ?
Dennis Koch
Dennis Koch12mo ago
No, resource file is run before middelware. You could output it as a column via getStateUsing()
vas
vasOP12mo ago
No description
Dennis Koch
Dennis Koch12mo ago
Hm, I don't know. Is this returning something different? You can run this from anywhere
Tenant::first()->run(fn () => Storage::disk('public')->url('test'))
Tenant::first()->run(fn () => Storage::disk('public')->url('test'))
vas
vasOP12mo ago
"http://localhost/storage/test" // app\Filament\Resources\ShopItemResource.php:64
"http://localhost/storage/test" // app\Filament\Resources\ShopItemResource.php:64
Dennis Koch
Dennis Koch12mo ago
So it's not Filament related. Something with your setup is wrong. You have the StorageBootstrapper enabled? Check the config for the bootstrappers, please.
vas
vasOP12mo ago
if i do this
Tables\Columns\ImageColumn::make('image')->disk('public')->getStateUsing(function ($record) {
return [
'url' => Storage::disk('public')->url('tenant' . tenant('id') . '/' . $record->image),
];
}),
Tables\Columns\ImageColumn::make('image')->disk('public')->getStateUsing(function ($record) {
return [
'url' => Storage::disk('public')->url('tenant' . tenant('id') . '/' . $record->image),
];
}),
it changes the path
vas
vasOP12mo ago
No description
Dennis Koch
Dennis Koch12mo ago
Sure, but that should work out of the box. Can you share the bootstrappers of your config/tenancy.php?
vas
vasOP12mo ago
sure
'bootstrappers' => [
Stancl\Tenancy\Bootstrappers\DatabaseTenancyBootstrapper::class,
Stancl\Tenancy\Bootstrappers\CacheTenancyBootstrapper::class,
Stancl\Tenancy\Bootstrappers\FilesystemTenancyBootstrapper::class,
Stancl\Tenancy\Bootstrappers\QueueTenancyBootstrapper::class,
// Stancl\Tenancy\Bootstrappers\RedisTenancyBootstrapper::class, // Note: phpredis is needed
],
'bootstrappers' => [
Stancl\Tenancy\Bootstrappers\DatabaseTenancyBootstrapper::class,
Stancl\Tenancy\Bootstrappers\CacheTenancyBootstrapper::class,
Stancl\Tenancy\Bootstrappers\FilesystemTenancyBootstrapper::class,
Stancl\Tenancy\Bootstrappers\QueueTenancyBootstrapper::class,
// Stancl\Tenancy\Bootstrappers\RedisTenancyBootstrapper::class, // Note: phpredis is needed
],
Dennis Koch
Dennis Koch12mo ago
Hm. FilesystemTenancyBootstrapper should do this. I am out of ideas.
vas
vasOP12mo ago
'asset_helper_tenancy' => false,
'asset_helper_tenancy' => false,
this is false if i put it true it breaks all the css/js in filament no worries man i really appreacite taking the time thank you , ill leave it to that im out of ideas too
Dennis Koch
Dennis Koch12mo ago
Yes that's correct. Again: asset_helper is unrelated to Storage.
vas
vasOP12mo ago
well
Tables\Columns\ImageColumn::make('image')->getStateUsing(function ($record) {
return [
'url' => tenant_asset( $record->image) ,
];
}),
Tables\Columns\ImageColumn::make('image')->getStateUsing(function ($record) {
return [
'url' => tenant_asset( $record->image) ,
];
}),
vas
vasOP12mo ago
No description
vas
vasOP12mo ago
@Dennis Koch can i do this for the form ?
Dennis Koch
Dennis Koch12mo ago
I don't think so, as it uses the Storage facade
madushanCS
madushanCS10mo ago
Hello. Anyone solve the img preview issue with Stancl Tenancy.
No description
Dan Harrin
Dan Harrin10mo ago
yeah, theres a config option to disable that behaviour i think
madushanCS
madushanCS10mo ago
Hi Dan, is this you mean. I checked asset_helper_tenancy true and false both. but still not working. I tried this, Tables\Columns\ImageColumn::make('logo') ->label('Logo') ->url(function (Team $record) { $url = Storage::disk('public')->url($record->logo); return Storage::disk('public')->url($record->logo); }), $fullPath = Storage::disk('public')->path($record->logo);
"D:\xxx\xxx\xxx\xxx\sass\storage/tenant3cea6d60-2b75-451d-af4b-92cd9ed9fc10/app/public\01HP7G59C3DHAFHVXREZ75W03Y.webp" $url = Storage::disk('public')->url($record->logo); "http://sass.test/storage/01HP7G59C3DHAFHVXREZ75W03Y.webp"
No description
Wannes
Wannes8mo ago
did you figure this out? 🙂 im having the same issue
vas
vasOP8mo ago
no buddy can't find any help on this anywhere what would that be ?
Majid Al Zariey
Majid Al Zariey8mo ago
We had to use SpatieMediaLibraryFileUpload to override the url generation as FileUpload does not provide an API for that. In the media-library config file

/*
* When urls to files get generated, this class will be called. Use the default
* if your files are stored locally above the site root or on s3.
*/
'url_generator' => TenantAwareUrlGenerator::class,

/*
* When urls to files get generated, this class will be called. Use the default
* if your files are stored locally above the site root or on s3.
*/
'url_generator' => TenantAwareUrlGenerator::class,
Then
use Spatie\LaravelSettings\Support;
use Spatie\MediaLibrary\Support\UrlGenerator\DefaultUrlGenerator;

class TenantAwareUrlGenerator extends DefaultUrlGenerator
{
public function getUrl(): string
{
$url = tenant_asset($this->getPathRelativeToRoot());

$url = $this->versionUrl($url);

return $url;
}
}
use Spatie\LaravelSettings\Support;
use Spatie\MediaLibrary\Support\UrlGenerator\DefaultUrlGenerator;

class TenantAwareUrlGenerator extends DefaultUrlGenerator
{
public function getUrl(): string
{
$url = tenant_asset($this->getPathRelativeToRoot());

$url = $this->versionUrl($url);

return $url;
}
}
Had Issue with this part, and stopped using it.
vas
vasOP8mo ago
ok thanks man , let me have a look at that much appreciated
Majid Al Zariey
Majid Al Zariey8mo ago
Are you using FileUpload or SpatieMediaLibraryFileUpload?
vas
vasOP8mo ago
fileupload the image uploads fine , its just getting the preview is not working and that in turn doesn't let me to change the image
vas
vasOP8mo ago
No description
vas
vasOP8mo ago
No description
vas
vasOP8mo ago
as its trying to fetch the image from central domain instead of tenant could not find a way to change this behaviour
Majid Al Zariey
Majid Al Zariey8mo ago
Yeah I had the same issue. Stop using the temporary_file_upload override and You would need to Override the FileUpload File using Composer (Which I dont Recommand) Thats why I switched to Spatie
vas
vasOP8mo ago
i will give spatie a go thank you
Majid Al Zariey
Majid Al Zariey8mo ago
Stop using the temporary_file_upload override <= meant the livewire config edit
vas
vasOP8mo ago
'middleware' => \Stancl\Tenancy\Middleware\InitializeTenancyByDomainOrSubdomain::class, // Example: 'throttle:5,1' | Default: 'throttle:60,1' ? this one ?
Majid Al Zariey
Majid Al Zariey8mo ago
Yes return the middleware to null,
vas
vasOP8mo ago
and use spatie i assume otherwise it throws an error
Majid Al Zariey
Majid Al Zariey8mo ago
Yeah
vas
vasOP8mo ago
cool let me get spatie installed is this a service TenantAwareUrlGenerator ? this is what i got
class ShopItem extends Model implements HasMedia
{
use HasFactory, InteractsWithMedia;
class ShopItem extends Model implements HasMedia
{
use HasFactory, InteractsWithMedia;
'url_generator' => TenantAwareUrlGenerator::class,
'url_generator' => TenantAwareUrlGenerator::class,
<?php

namespace App\Services;

use Spatie\LaravelSettings\Support;
use Spatie\MediaLibrary\Support\UrlGenerator\DefaultUrlGenerator;

class TenantAwareUrlGenerator extends DefaultUrlGenerator
{
public function getUrl(): string
{
$url = tenant_asset($this->getPathRelativeToRoot());

$url = $this->versionUrl($url);

return $url;
}
}
<?php

namespace App\Services;

use Spatie\LaravelSettings\Support;
use Spatie\MediaLibrary\Support\UrlGenerator\DefaultUrlGenerator;

class TenantAwareUrlGenerator extends DefaultUrlGenerator
{
public function getUrl(): string
{
$url = tenant_asset($this->getPathRelativeToRoot());

$url = $this->versionUrl($url);

return $url;
}
}
SpatieMediaLibraryFileUpload::make('image')
->directory('items')
->downloadable()
->maxSize(1024)
->image(),
SpatieMediaLibraryFileUpload::make('image')
->directory('items')
->downloadable()
->maxSize(1024)
->image(),
vas
vasOP8mo ago
No description
Majid Al Zariey
Majid Al Zariey8mo ago
Check the TenancyServiceProvider
Majid Al Zariey
Majid Al Zariey8mo ago
and check whether the storage/tenant-name/framework/cache folder is there
vas
vasOP8mo ago
did you install the filament plugin https://filamentphp.com/plugins/filament-spatie-media-library ? or spatie/laravel-medialibrary
Filament
Spatie Media Library by Filament - Filament
Filament support for Spatie's Laravel Media Library package.
vas
vasOP8mo ago
Events\TenancyEnded::class => [
Listeners\RevertToCentralContext::class,
],

Events\BootstrappingTenancy::class => [],
Events\TenancyBootstrapped::class => [

],
Events\TenancyEnded::class => [
Listeners\RevertToCentralContext::class,
],

Events\BootstrappingTenancy::class => [],
Events\TenancyBootstrapped::class => [

],
these is mine
Events\TenancyEnded::class => [
function (Events\TenancyEnded $event) {
app(\Spatie\Permission\PermissionRegistrar::class)->cacheKey = 'spatie.permission.cache';
},
Listeners\RevertToCentralContext::class,
],

Events\BootstrappingTenancy::class => [],
Events\TenancyBootstrapped::class => [
function (Events\TenancyBootstrapped $event) {
app(\Spatie\Permission\PermissionRegistrar::class)->cacheKey = 'spatie.permission.cache.tenant.' . $event->tenancy->tenant->id;
}
],
Events\TenancyEnded::class => [
function (Events\TenancyEnded $event) {
app(\Spatie\Permission\PermissionRegistrar::class)->cacheKey = 'spatie.permission.cache';
},
Listeners\RevertToCentralContext::class,
],

Events\BootstrappingTenancy::class => [],
Events\TenancyBootstrapped::class => [
function (Events\TenancyBootstrapped $event) {
app(\Spatie\Permission\PermissionRegistrar::class)->cacheKey = 'spatie.permission.cache.tenant.' . $event->tenancy->tenant->id;
}
],
this is yours
Majid Al Zariey
Majid Al Zariey8mo ago
if you are not using Spatie Permissions or Filament Shield you could ignore that Check this
vas
vasOP8mo ago
ok im doing that already
Majid Al Zariey
Majid Al Zariey8mo ago
Here is my tenancy config file
Majid Al Zariey
Majid Al Zariey8mo ago
Any Luck?
vas
vasOP8mo ago
what i didn't have is Stancl\Tenancy\Features\CrossDomainRedirect::class, // https://tenancyforlaravel.com/docs/v3/features/cross-domain-redirect
Tenancy for Laravel
Cross-domain redirect | Tenancy for Laravel
Cross-domain redirect | Tenancy for Laravel
vas
vasOP8mo ago
but still getting the same , i might need to install telescope see what is giving me that 500 error
Majid Al Zariey
Majid Al Zariey8mo ago
try reverting back the livewire middleware setting what will happen?
vas
vasOP8mo ago
is uploading the file now but is giving still 500 err
vas
vasOP8mo ago
No description
vas
vasOP8mo ago
which is better at least is using the right domain
Majid Al Zariey
Majid Al Zariey8mo ago
after save?
vas
vasOP8mo ago
yea
Majid Al Zariey
Majid Al Zariey8mo ago
could you check the storage folder , for the file
vas
vasOP8mo ago
before save
No description
vas
vasOP8mo ago
let me do a migrate fresh and resigser a fresh tenant its a mess in here
vas
vasOP8mo ago
No description
vas
vasOP8mo ago
No description
Majid Al Zariey
Majid Al Zariey8mo ago
and the error for this image?
vas
vasOP8mo ago
No description
vas
vasOP8mo ago
if i go on the image link directly i get http://apex.localhost/tenancy/assets/1/01HVCWDBSF1JF4JHCZMV90Y84V.png ups Tenant could not be identified on domain apex.localhost
Majid Al Zariey
Majid Al Zariey8mo ago
Which middleware are you using in the panel?
vas
vasOP8mo ago
looking at this is trying to use domain only
No description
vas
vasOP8mo ago
InitializeTenancyByDomainOrSubdomain::class, in the panel
Majid Al Zariey
Majid Al Zariey8mo ago
try using InitializeTenancyByDomain::class, PreventAccessFromCentralDomains::class,
vas
vasOP8mo ago
nah , got it had to stick this in
TenantAssetsController::$tenancyMiddleware = InitializeTenancyByDomainOrSubdomain::class;
TenantAssetsController::$tenancyMiddleware = InitializeTenancyByDomainOrSubdomain::class;
public function boot() in tenancy provider
Majid Al Zariey
Majid Al Zariey8mo ago
Yeah I noticed that the error is using the InitializeTenancyByDomain did everything work now?
vas
vasOP8mo ago
haha seems so thanks a lot i owe you big time 🙂 just in the blade how do you retrieve the image do you use tenant_asset ? oh nvm i see it makes a link very nice
vas
vasOP8mo ago
No description
Majid Al Zariey
Majid Al Zariey8mo ago
I didnt need it in my case, but yes. You should. You could also use Spatie in the blade
vas
vasOP8mo ago
how if you dont mind ?
Majid Al Zariey
Majid Al Zariey8mo ago
If you are using Livewire component, using Forms in Livewire is simple and easy
vas
vasOP8mo ago
yea im using that
Majid Al Zariey
Majid Al Zariey8mo ago
just make a form and use it
vas
vasOP8mo ago
ok , listen thanks a bunch i was losing hope on this 🙂
Majid Al Zariey
Majid Al Zariey8mo ago
I had to suffer as well. couldnt find a good guide to support uploading files. Good luck
vas
vasOP8mo ago
thanks again man best of luck to you too
Majid Al Zariey
Majid Al Zariey8mo ago
Anytime
vas
vasOP8mo ago
i ended up doing this for now
@php $mediaItems = $item->getMedia() @endphp
<img src="{{ $mediaItems[0]->getUrl() }}" class="w-24 h-24 rounded-l">
@php $mediaItems = $item->getMedia() @endphp
<img src="{{ $mediaItems[0]->getUrl() }}" class="w-24 h-24 rounded-l">
awcodes
awcodes8mo ago
Curator doesn’t use spatie’s package for this exact reason. Just saying. 😅
CGM
CGM7mo ago
I hope this is ok, but I wanted to cross reference another solution in another thread seemingly solved by @camya. He used a middleware and a modified CreateFrameworkDirectoriesForTenant::class job to solve it in a pretty solid way. https://discord.com/channels/883083792112300104/1223843491386228796/1241067799485354054 Got uploads working now in Panels and in Custom Filament Forms (outside of panels). Other than his notes I had to go back into the tenancy for laravel setup regarding Livewire to make some changes, but nothing not documented there or in @camya's post.
vas
vasOP7mo ago
Thanks
Want results from more Discord servers?
Add your server