JamesTechDude
JamesTechDude
Explore posts from servers
FFilament
Created by JamesTechDude on 8/21/2023 in #❓┊help
How to remove Form from View page
@josef Thank you, I'll check into infolist I have a relationship manager and I'm trying to show just the relationship manager on the edit or view page, but someone gave me a tabbed idea that seems to work better that I can get rid of the view page and just keep it the edit page - so I may just do that 🙂
6 replies
FFilament
Created by DS on 8/10/2023 in #❓┊help
is there a way to use spatie roles with teams id and filament multenancy on V3 ?
I think you may want to remove the teams functionality from Spatie and utilize Filament to do the rest for you. We just need to figure out how to set the company_id to a user/role
122 replies
FFilament
Created by JamesTechDude on 8/21/2023 in #❓┊help
How to remove Form from View page
@ZedoX Sorry, the view form (that lets you view the current user's information) Typically it's an edit form, but when you make a view, it's the same edit form - just disabled I meant to say Form, not Table - my fault
6 replies
FFilament
Created by DS on 8/10/2023 in #❓┊help
is there a way to use spatie roles with teams id and filament multenancy on V3 ?
@DS also check that relationship and make sure it's returning what it should, use dd($roles) in controller function (before the return) and it should output the values it grabbed I think I wrote the relationship incorrectly as well :/
122 replies
FFilament
Created by DS on 8/10/2023 in #❓┊help
is there a way to use spatie roles with teams id and filament multenancy on V3 ?
@tuto1902 Do you think you can assist with this? 😮 I know you know a ton about this stuff 🙂 https://filamentphp.com/docs/3.x/panels/resources/relation-managers#attaching-and-detaching-records
122 replies
FFilament
Created by DS on 8/10/2023 in #❓┊help
is there a way to use spatie roles with teams id and filament multenancy on V3 ?
Do you maybe have a demo repo of this?
122 replies
FFilament
Created by DS on 8/10/2023 in #❓┊help
is there a way to use spatie roles with teams id and filament multenancy on V3 ?
@DS So I see you are trying to put all roles into an array that belong to that specific company... I would move this to the Company model as a function:
public function roles()
{
$roles = Role::where('company_id', Filament::getTenant()->id)->get()->pluck('id')->toArray();

return $roles;
}
public function roles()
{
$roles = Role::where('company_id', Filament::getTenant()->id)->get()->pluck('id')->toArray();

return $roles;
}
And then you can just call that relationship instead of running the query directly, especially so it's in 1 central location in case you need to change it in the future for all spots that need to grab the roles... Let me see about the rest though
122 replies
FFilament
Created by DS on 8/10/2023 in #❓┊help
is there a way to use spatie roles with teams id and filament multenancy on V3 ?
@BKF Dev @DS
122 replies
FFilament
Created by DS on 8/10/2023 in #❓┊help
is there a way to use spatie roles with teams id and filament multenancy on V3 ?
You can also use Policies (through laravel Policies) to setup permissions but that's pretty much it - as far as I know
122 replies
FFilament
Created by DS on 8/10/2023 in #❓┊help
is there a way to use spatie roles with teams id and filament multenancy on V3 ?
With Filament, it's difficult to understand sometimes, but everything is based on the team_id already that you don't need to assign a team_id in roles. I would get rid of that completely on the roles side and change your tables to have the team_id field, or have pivot tables like post_user for Posts that belong to a User The rest is handled at the highest level of multi tenancy As far as I know, there isn't a way yet to have multiple Roles with multiple Teams for 1 User You can only have 1 Role with multiple Teams for 1 User. The rest is handled through the specific table themselves (like a posts table), where a team_id is set to the specific record (or through a pivot table) This has taken me a lot to understand too, so I get where you're coming from, but there's no way to set the team_id to the roles table as far as I've found. Instead, it's set at the resource level (Posts, Articles, etc) and in their specific tables or through pivot relationship which is still only using the team ID and the Model ID (no Role ID) The only time you need team_id in the role assignment table, is when 1 User has multiple Roles for different Teams
122 replies
FFilament
Created by skpi4u on 8/19/2023 in #❓┊help
Role based access of resources
@josef said it best on another thread: Panels are a set of resources. So you can have a panel for e.g. sales that see one set of resource, while the admin sees another. If both see the same set of resources, but have different permissions, one panel and policies should work best. For you, it sounds like you will have the same resources for everyone but just want to limit which ones certain people see: - First administrator can see everything - Branch admin can manage only their own branch - and more In this case I would look into Policies, which is a Laravel thing that Filament will honor/use seamlessly: https://laravel.com/docs/10.x/authorization#creating-policies I also recommend this video that @tuto1902 made that touches bases on this policy setup, fast forward to about 57 minutes 48 seconds: https://www.youtube.com/watch?v=a9u_ByM5YCk
2 replies
FFilament
Created by Albert Lens on 8/20/2023 in #❓┊help
Please suggest deployment servers for filamentphp3
I personally use A2Hosting, unmanaged VPS Server, Almalinux I then SSH into it with VS Code to do any coding/editing/etc (use SSH keys! and turn off password login) You can setup git very easily and use "git pull" and "git push" to keep up to date with your online repo (use SSH keys as well) If you really wanted to, you can also setup a cronjob to keep it updated on it's own by doing "git pull" however often you want, but this isn't recommended for production folders This is around $70 USD per month, though, for a fast server For a cheap/slower server, it's as cheap as around $5 to $30 USD per month (I think) This will give you a server to use that will be online 99% of the time. And the only way to access it is through WHM/cPanel, or SSH You can get their managed VPS server for around $10 to $20 USD more per month, which I recommend if you're new to linux/WHM/cPanel. This will let you still have admin access (running npm, artisan, and other commands), but they will set up the server for you and manage it if you have any issues
11 replies