Gunnolfson
Gunnolfson
FFilament
Created by Gunnolfson on 5/13/2024 in #❓┊help
Table page without Eloquent Model
So creating a livewire component and using blade component is the way to do for the moment?
7 replies
FFilament
Created by Gunnolfson on 5/13/2024 in #❓┊help
Table page without Eloquent Model
Ok thanks 👍
7 replies
FFilament
Created by Gunnolfson on 7/15/2023 in #❓┊help
Change resource ID for FileUpload form field
I wonder if there's any uuid package to make optimised uuid an ease to use, and also compatible with Filament
9 replies
FFilament
Created by Gunnolfson on 7/15/2023 in #❓┊help
Change resource ID for FileUpload form field
9 replies
FFilament
Created by Gunnolfson on 7/15/2023 in #❓┊help
Change resource ID for FileUpload form field
It does not, it only stores the path on a property like varchar(255) - avatar
9 replies
FFilament
Created by Gunnolfson on 7/15/2023 in #❓┊help
Change resource ID for FileUpload form field
Same, I don't understand how the identifier of the resource is related to the file upload and I don't really know how to look for (in the file upload file I guess, but didn't figure out what was going on) The 404 is trigerred right on the page load: it loads, I see the form, and a 404 popup opens immediatly. Not sure it helps you 😅
9 replies
FFilament
Created by Gunnolfson on 7/15/2023 in #❓┊help
Change resource ID for FileUpload form field
Any idea? 😅
9 replies
FFilament
Created by Gunnolfson on 7/10/2023 in #❓┊help
Binary Ulids
Seems Laravel Eloquent works fine with the ulid charset set as a binary(16) but it breaks the json encode function, which is required to work for Laravel Livewire/Laravel Filament. I'm ** 😭
3 replies
FFilament
Created by Gunnolfson on 7/10/2023 in #❓┊help
Binary Ulids
Disabling the cast allows me to log in successfully but I get this error. So the login fails if I enable the cast on ulid. Now that I'm logged in, I can enable the cast again, and it displays correctly the table, but every resource page (edit/detail) fails with a 404 :/
3 replies
FFilament
Created by Gunnolfson on 6/27/2023 in #❓┊help
Relation manager with intermediate relationship
I indeed actually solved it using a view like so:
CREATE OR REPLACE VIEW course_school_view AS
SELECT courses.id as course_id, schools.id as school_id FROM courses
INNER JOIN course_specialism ON courses.id = course_specialism.course_id
INNER JOIN specialisms ON course_specialism.specialism_id = specialisms.id
INNER JOIN schools ON specialisms.school_id = schools.id;
CREATE OR REPLACE VIEW course_school_view AS
SELECT courses.id as course_id, schools.id as school_id FROM courses
INNER JOIN course_specialism ON courses.id = course_specialism.course_id
INNER JOIN specialisms ON course_specialism.specialism_id = specialisms.id
INNER JOIN schools ON specialisms.school_id = schools.id;
This way I can simulate a School::belongsToMany(Course::class, 'course_slug') behavior 👍 I guess I just miss the associate/dissociate features as a view is readonly, but it should be ok for us Thanks for your help 🙏
17 replies
FFilament
Created by Gunnolfson on 6/27/2023 in #❓┊help
Relation manager with intermediate relationship
This morning you inspired me a solution based on a view, adding the school ID on the course, creating a dedicated CourseSchool model just for the table. I guess then I can override the urls for the actions 🤔 (to actually use the Course model)
17 replies
FFilament
Created by Gunnolfson on 6/27/2023 in #❓┊help
Relation manager with intermediate relationship
Hmm ok I see the attaching actions. I've found out that there is indeed the getTableQuery method, which is possible to override. However I don't see how it's possible to write it 😅 Is there a specific way to get the query builder as I don't have a relationship? Or should I give the specialisms relationship, serving as a start point? 🤔
17 replies
FFilament
Created by Gunnolfson on 6/27/2023 in #❓┊help
Relation manager with intermediate relationship
Oh, that sounds interesting 🤔 I'll look into that. I guess it's unusual thus not documented 😅
17 replies
FFilament
Created by Gunnolfson on 6/27/2023 in #❓┊help
Relation manager with intermediate relationship
It's deadly simple to have a sql query, but not to plug it to the ❤️ relation manager
17 replies
FFilament
Created by Gunnolfson on 6/27/2023 in #❓┊help
Relation manager with intermediate relationship
It would be way more convenient than having to open a specific specialism
17 replies
FFilament
Created by Gunnolfson on 6/27/2023 in #❓┊help
Relation manager with intermediate relationship
17 replies
FFilament
Created by Gunnolfson on 6/27/2023 in #❓┊help
Relation manager with intermediate relationship
It doesn't handle the belongs to many relationship. I'd rather need a belongsToManyThroughMany 😄
17 replies
FFilament
Created by Gunnolfson on 6/21/2023 in #❓┊help
Cannot delete test
Yes, and the method (or trait) checks that for resource given, let's say FooResource, checks it again "bulk action", "page action", and "table action" 🤔 I guess the signature could be something like
assertItCannotDelete(
resource: $resource,
actor: $actor,
tableAction: $tableAction = true,
bulkAction: $bulkAction = true,
editPageAction: $editPageAction = true
)
assertItCannotDelete(
resource: $resource,
actor: $actor,
tableAction: $tableAction = true,
bulkAction: $bulkAction = true,
editPageAction: $editPageAction = true
)
So that It can be used like so:
test('this admin cannot delete these resource', function () {
$admin = Admin::factory()->create();
$resource = Resource::factory()->create();

assertItCannotDelete($resource, $actor);
});
test('this admin cannot delete these resource', function () {
$admin = Admin::factory()->create();
$resource = Resource::factory()->create();

assertItCannotDelete($resource, $actor);
});
5 replies