einnlleinhatt_
einnlleinhatt_
Explore posts from servers
TLCTuto's Laravel Corner
Created by einnlleinhatt_ on 12/16/2023 in #💡filament
Filament Test
Good evening, can anyone help with filament test using pest. I wanted to test the dashboard panel login. For examples can't be accessed by guest and redirect it to the login page.
3 replies
FFilament
Created by einnlleinhatt_ on 11/7/2023 in #❓┊help
Multiple Image and Featured Image
Good evening, I wanted to have a pet details with pet avatar and some the pets related gallery. Any advice how to achieve this ? Im planning to have max 5 images uploading into the pet record, but im stuck how to choose 1 image out of the 5 for the pet avatar ?
pets table

Schema::create('pets', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('name');
$table->date('birth_of_date');
$table->string('breed');
$table->string('gender');
$table->string('size')->nullable();
$table->string('tags');
$table->integer('age')->nullable();
$table->string('gallery')->nullable();
$table->text('description');
$table->timestamps();
$table->softDeletes();
});
pets table

Schema::create('pets', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('name');
$table->date('birth_of_date');
$table->string('breed');
$table->string('gender');
$table->string('size')->nullable();
$table->string('tags');
$table->integer('age')->nullable();
$table->string('gallery')->nullable();
$table->text('description');
$table->timestamps();
$table->softDeletes();
});
Im thinking about changing the $table->string('gallery')->nullable(); into $table->string('avatar')->nullable(); and make a separate table called pet_image.
2 replies
FFilament
Created by einnlleinhatt_ on 10/27/2023 in #❓┊help
Tabs
Good evening, i have a question about customizing tabs. I have a relationship between projects and services table. Here is the table.
Project Table
Schema::create('projects', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->uuid('service_id')->nullable();
$table->string('name');
$table->string('slug')->unique();
$table->string('image')->nullable();
$table->string('description');
$table->timestamps();
});

Schema::table('projects', function (Blueprint $table) {
$table->foreign('service_id')
->references('id')
->on('services');
});
Project Table
Schema::create('projects', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->uuid('service_id')->nullable();
$table->string('name');
$table->string('slug')->unique();
$table->string('image')->nullable();
$table->string('description');
$table->timestamps();
});

Schema::table('projects', function (Blueprint $table) {
$table->foreign('service_id')
->references('id')
->on('services');
});
Service Table
Schema::create('services', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('name');
$table->string('slug')->unique()->nullable();
$table->string('description')->nullable();
$table->string('icon');
$table->timestamps();
});
Service Table
Schema::create('services', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('name');
$table->string('slug')->unique()->nullable();
$table->string('description')->nullable();
$table->string('icon');
$table->timestamps();
});
My goal is to show all projects for each service and the total projects. I managed to implement the tabs but without the total projects of each service.
3 replies
FFilament
Created by einnlleinhatt_ on 10/23/2023 in #❓┊help
Showing icon preview
Is there a way to preview icon select using allowhtml()?
3 replies
FFilament
Created by einnlleinhatt_ on 10/23/2023 in #❓┊help
URL
Good evening, is there a way to change how the urls link ? For example i have a user with uuid as an id. Can i change the url to mydomain.com/admin/username instead of the uuid ?
7 replies
FFilament
Created by einnlleinhatt_ on 10/15/2023 in #❓┊help
Options with multiple condition.
Good evening, how to list an option from database with multiple condition ? At the moment im still using relationship and only have 1 condition.
Select::make('parent_id')
->label('Category')
->relationship('mainCategory', 'name', fn (Builder $query)
=>$query->where('parent_id', '=', NULL))
->searchable()
->placeholder('Select parent category'),
Select::make('parent_id')
->label('Category')
->relationship('mainCategory', 'name', fn (Builder $query)
=>$query->where('parent_id', '=', NULL))
->searchable()
->placeholder('Select parent category'),
What i want to achieve is, the option will only show category with parent_id is null and the status is active.
6 replies
FFilament
Created by einnlleinhatt_ on 10/10/2023 in #❓┊help
Navigation
No description
6 replies
FFilament
Created by einnlleinhatt_ on 10/8/2023 in #❓┊help
2 Resources 1 Model
Good evening, I have a Category model and migration. My goal is to have a category and sub categor. Everything is smooth until I want a separate resources for category and sub category. For example inside CategoryResource only have - Image - Name - Status And in inside the SubCategoryResource will have - Image - Name - Category - Ststus Any advice how to achieve this?
18 replies
FFilament
Created by einnlleinhatt_ on 10/8/2023 in #❓┊help
List view customize
No description
4 replies
FFilament
Created by einnlleinhatt_ on 10/3/2023 in #❓┊help
Livewire
Anyone can help me passing data into view with livewire? I have a resumes.index and I need to pass data from 2 tables.
23 replies
FFilament
Created by einnlleinhatt_ on 9/27/2023 in #❓┊help
Relationship belongstoMany
Good evening, I tried to make my own portfolio using filament since I'm not good at frontend. My goal is a project can have many tags and a tags can have many project too. For example Project A Tag1, Tag2, Tag3 Project B Tag2, Tag3 Project C Tag3 I followed the filament code source on GitHub for the database migration. On the filament demo, a product can have multiple categories. So I check the database migration for tables product, there is no category_id in it but I can create a product with multiple categories. In my case I need to add foreignUuid for tag_id inside my projects table. Anyone can explain to me ?
34 replies
FFilament
Created by einnlleinhatt_ on 9/25/2023 in #❓┊help
Edit not working
I am going through a tutorial and have watched the same video a few times to see if I had incorrect syntax on my form, but to me it looked ok. But when I hit 'edit' and then click save changes I get an error that the value already exists. This is happening on each of the forms I created.
public static function form(Form $form): Form
{
return $form
->schema([
Group::make()
->schema([
Section::make()
->schema([
TextInput::make('name')
->required()
->live(onBlur:true)
->unique()
->afterStateUpdated(function(string $operation, $state, Forms\Set $set){
if($operation!=='create'){
return;
}
$set('slug', Str::slug($state));

})

])
]);
}
public static function form(Form $form): Form
{
return $form
->schema([
Group::make()
->schema([
Section::make()
->schema([
TextInput::make('name')
->required()
->live(onBlur:true)
->unique()
->afterStateUpdated(function(string $operation, $state, Forms\Set $set){
if($operation!=='create'){
return;
}
$set('slug', Str::slug($state));

})

])
]);
}
6 replies