Closed demobiel closed 2 months ago
Investigating further I see that there is the Concern CanConstructRoute that expects a slug on the tenant, but even when I implement that I always get $tenant->slug => null
.
But getting further with this :)
ok, I think I found out you expect a "slug" attribute on the tenant model. I will see if I can rework this and do a pull request so you can use the id, or defined slug attribute.
I'm a bit struggling with all the requirements to calculate the correct route, because there are tenants, multiples panels, custom pages routes...
That's a functionnality that I need to rewrite, with a clear head.
I completely understand.
I wanted to propose a PR, but I got stuck in the getURL method, I have the feeling there might be a bug on Filament's well when calculating the routes for Resourcepages (edit, list and create)
On 21 Sep 2023, at 18:17, Jibay Mcs @.***> wrote:
I'm a bit struggling with all the requirements to calculate the correct route, because there are tenants, multiples panels, custom pages routes...
That's a functionnality that I need to rewrite, with a clear head.
— Reply to this email directly, view it on GitHub https://github.com/JibayMcs/filament-tour/issues/5#issuecomment-1729897132, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC7LAWFGA7MCFUNVNUQC23X3RSA5ANCNFSM6AAAAAA475MMRI. You are receiving this because you authored the thread.
I am interested in fixing
Is working fine to me, the only bug that I have so far is when I'm in the login route, it shows a
-> Error: Call to a member function getTenants() on null in file /var/www/html/vendor/jibaymcs/filament-tour/src/Tour/Traits/CanConstructRoute.php on line 21
digging into it, you are trying to get the tenant from the authenticated user Filament::auth()->user()
but at this stage (login) there's no auth user yet. That's why I'm getting this error: Call to a member function getTenants() on null
$tenants = Filament::getCurrentPanel()->getTenantModel()::find(Filament::auth()->user()->getTenants(Filament::getCurrentPanel()));
digging into it, you are trying to get the tenant from the authenticated user
Filament::auth()->user()
but at this stage (login) there's no auth user yet. That's why I'm getting this error:Call to a member function getTenants() on null
$tenants = Filament::getCurrentPanel()->getTenantModel()::find(Filament::auth()->user()->getTenants(Filament::getCurrentPanel()));
did you manage to fix this? I keep getting "Call to a member function getTenants() on null"
digging into it, you are trying to get the tenant from the authenticated user
Filament::auth()->user()
but at this stage (login) there's no auth user yet. That's why I'm getting this error:Call to a member function getTenants() on null
$tenants = Filament::getCurrentPanel()->getTenantModel()::find(Filament::auth()->user()->getTenants(Filament::getCurrentPanel()));
did you manage to fix this? I keep getting "Call to a member function getTenants() on null"
No sir, I couldn't... just waiting to see if there's a solution from the author.
Hi all,
I encountered this error today and got around it by adding a check in the tours function to return an empty array if a user isn't logged in:
class ListDocuments extends ListRecords
{
use HasTour;
...
public function tours(): array
{
if (! request()->user()) {
return [];
}
return [
Tour::make('list_documents')
->steps(
Step::make('.fi-ta')
->title('Your documents')
->description('This table contains all of your and your teams documents. From here you can edit or delete them'),
Step::make('[data-id=new_document]')
->title('New document')
->description('Clicking here will allow you to create a new document')
->icon('heroicon-o-document')
->iconColor('primary'),
),
];
}
}
With this change I can use all of the authentication pages without an error and the tours work on the pages I have defined them
Hi ! This bug will be fixed in the next release :)
Fixed here (I hope so): https://github.com/JibayMcs/filament-tour/releases/tag/v3.1.0.6
What happened?
At the moment I am not able to make a tour show up, unless I specificaly set the "ignoreRoutes()" to true on the tour itself.
this is the code I have on my resourceEditPage:
I investigated the issue (a bit) and what I can see in the index.js file is:
I guess the default behaviour should be the last statement: the route matches and it has never been shown. However as my tour.route is always null, this condition is always false.
not sure what I am doing wrong. Do I have to register my routes where it should be visual manually (in the example given this is not done however). I don't find in the code where the routes are "automagically" set, so I guess I have to do it manually.
How to reproduce the bug
I am not sure how to reproduce this, as I am not sure that I am actually using it right...
Package Version
v3.1.0.2
PHP Version
8.1.6
Laravel Version
10.20.0
Filament Version
v3.0.31
Which operating systems does with happen with?
macOS
Notes
No response