Stefan
Explore posts from serversnuxt3 with nuxtUI Failed to resolve component UPage
Hi,
I installed a fresh nuxt3 app and added nuxtUI according the instalation guides.
in my app.vue, I added this content
and this is my VerticalManu, component file
The problem is that I get this warnings in the console and I do not know how to get over it.
I mention that if I add a <UButton>click me</UButton> in the main <div> of app.vue and delete everything else, I see the button in the browser.
Any help will be much appreciated! 😚
2 replies
TLCTuto's Laravel Corner
•Created by Stefan on 3/4/2024 in #💡filament
form builder
can anyone help me hoe to think this?
thanks!
3 replies
error: Group::isContained does not exist
On the Resource classes where I use Form Group Components, on create and edit routes i get Method Filament\Forms\Components\Group::isContained does not exist.
If I comment the Forms\Components\Group::make()->schema([...]) and I use Forms\Components\Tabs\Tab::make()->schema([...]) I get Tab::isContained does not exist.
Thanks!
2 replies
TLCTuto's Laravel Corner
•Created by Stefan on 1/11/2024 in #💡filament
attach properties to products - many to many relation
I have ProductResource and I want to associate some Properties to each product. For this I made a PropertiesRelationalManager
The PropertyResource is bind of Property model and to the properties table. The properties table have the 2 columns, id and name
The property values are stored in the property_values table which have the following columns: id, property_id and value
I have a pivot table product_property with the following columns: id, product_id, property_value_id, property_id and quantity
I created a PropertiesRelationManager and registered on the ProductResource and it’s form method looks like this:
public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Select::make('property_id')->label('Properties')
->relationship('properties', 'name')
->options(Property::all()->pluck('name', 'id'))
->live()
->required(),
Forms\Components\Select::make('property_value_id')->label('Values')
->relationship('properties.values', 'value')
->options(function (Forms\Get $get) {
$property = Property::find($get('property_id'));
return $property ? $property->values->pluck('value', 'id') : [];
})
->live()
->required(),
Forms\Components\TextInput::make('quantity'),
]);
}
Now when I want to save, I get Call to a member function associate() on null
Any help will be much appreciated!
3 replies
attach properties to products
I want to assign properties to the products:
Product Model:
Product Table
products
fields:
I have registered PropertiesRelationManager::class on the ProductRequest
Property Model:
Property Table properties
fields:
PropertyValue Model:
Table property_values
with the followings fields:
ProductProperty Model:
ProductProperty Table product_properties
fields:
PropertiesRelationManager:
When I save, I get: Array to string conversion
I guess that this happens because I declared multiple() on Select::make('property_value_id') and what I select is passed as array and my field property_value_id
accepts an integer.
For each selected value in this Select::make('property_value_id') I want to add a record in the product_properties table not a single record with all the values as if the property_value_id would be of type json.
Thanks for your time!2 replies
update relative table
I have a product resource class where in the main form I have only fields that belongs to the products table and all updates go fine.
Now, if I add two more fields to the main form, like gross_price, net_price. I want to store them in a table named product_prices.
When I try to update the price fields that are the product_prices table, I get an error
It tries to update the products table and not the product_prices table.
What to do in order to be able to also update the relative tables when I update any of the fields in the form?
Thanks in advance!
7 replies