Ninja++
Ninja++
Explore posts from servers
FFilament
Created by Ninja++ on 8/23/2023 in #❓┊help
Show price when item selected.
i would rather them see it so they can see the impact of their choice on the price.
34 replies
FFilament
Created by Ninja++ on 8/23/2023 in #❓┊help
Show price when item selected.
Or am i misunderstanding you?
34 replies
FFilament
Created by Ninja++ on 8/23/2023 in #❓┊help
Show price when item selected.
I am not trying to hide it im just trying to have it update as you change your selections for material, there is also a priority checkbox that is on another part of the form that i will need to add a static amount too this for also
34 replies
FFilament
Created by Ninja++ on 8/23/2023 in #❓┊help
Show price when item selected.
I don't understand
34 replies
FFilament
Created by Ninja++ on 8/23/2023 in #❓┊help
Show price when item selected.
is the intention that i use like this?
TextInput::make('cost')
->label('Cost to print these items')
->default(1)
->disabled()
->numeric()
->required()
->prefixIcon('heroicon-m-currency-pound')
->columnSpan(1)
->formatStateUsing(static function (Get $get) {
$volume = $get('volume');
$pricePermm = $get(...);
$result = // calculation
return $result;
}),
TextInput::make('cost')
->label('Cost to print these items')
->default(1)
->disabled()
->numeric()
->required()
->prefixIcon('heroicon-m-currency-pound')
->columnSpan(1)
->formatStateUsing(static function (Get $get) {
$volume = $get('volume');
$pricePermm = $get(...);
$result = // calculation
return $result;
}),
34 replies
FFilament
Created by Ninja++ on 8/23/2023 in #❓┊help
Show price when item selected.
Just this and my file downloading issue and i can tidy everything up for the submission. Then i can actually experment without this crazy time presure and actually have some fun with it.
34 replies
FFilament
Created by Ninja++ on 8/23/2023 in #❓┊help
Show price when item selected.
I will have to also figure out how to query the pricePermm depending on what material is selected.
34 replies
FFilament
Created by Ninja++ on 8/23/2023 in #❓┊help
Show price when item selected.
Thank you so much @josef I will experiment and post any additional challenges in this thread.
34 replies
FFilament
Created by Ninja++ on 8/23/2023 in #❓┊help
Show price when item selected.
Right now what i think the first problem is i am unable to get the pricePermm3 value from the selected material when it is chosen from the dropdown. I would like to save that as a variable so i can use it in the overall price calculation
34 replies
FFilament
Created by Ninja++ on 8/23/2023 in #❓┊help
Show price when item selected.
Yes that was my strategy to know when they had finished entering their values and i could then perform the operations using
->afterStateUpdated
->afterStateUpdated
34 replies
FFilament
Created by Ninja++ on 8/23/2023 in #❓┊help
Show price when item selected.
Right now i can just pull the volume and perform math operators on it and have that value be shown in a disabled textinput.
34 replies
FFilament
Created by Ninja++ on 8/23/2023 in #❓┊help
Show price when item selected.
You mean i should add an addition
->live(),
->live(),
to this for example?
Select::make('pricePermm3')
->label('Price Per mm3')
->options(Materials::all()->pluck('name', 'id'))
->default(1)
->disabled()
->required()
->prefixIcon('heroicon-m-beaker')
->columnSpan(1)
->live(onBlur: true),
Select::make('pricePermm3')
->label('Price Per mm3')
->options(Materials::all()->pluck('name', 'id'))
->default(1)
->disabled()
->required()
->prefixIcon('heroicon-m-beaker')
->columnSpan(1)
->live(onBlur: true),
34 replies
FFilament
Created by Ninja++ on 8/23/2023 in #❓┊help
Show price when item selected.
The final formula i am trying to achieve is volume + (selected materials) pricePermm3 * by quantity to get the final price.
34 replies
FFilament
Created by Ninja++ on 8/23/2023 in #❓┊help
Show price when item selected.
@josef tagging you as requested thank you for offering to help.
34 replies
FFilament
Created by Ninja++ on 8/23/2023 in #❓┊help
Call to undefined method App\Models\Projects::brand()?
Ok, looks like i copied a section over from the demo code that i left in the project resource. Never mind me im going to slowly walk away in shame and try to make this form be able to give you a final price 😦
6 replies
FFilament
Created by Ninja++ on 8/21/2023 in #❓┊help
syntax error, unexpected identifier "Stat", expecting "function" or "const"
I read the error see all the parts and get them individually but I'm struggling to parse that into what I need to do
14 replies
FFilament
Created by Ninja++ on 8/21/2023 in #❓┊help
syntax error, unexpected identifier "Stat", expecting "function" or "const"
Yes I generated via the CLI
14 replies
FFilament
Created by Ninja++ on 8/21/2023 in #❓┊help
Wizard Step type error
Thank you very much @Leandro Ferreira I see what i did wrong now
9 replies
FFilament
Created by Ninja++ on 8/21/2023 in #❓┊help
syntax error, unexpected identifier "Stat", expecting "function" or "const"
<?php

namespace App\Filament\Resources\MaterialsResource\Pages;

use App\Filament\Resources\MaterialsResource;
use Filament\Actions;
use Filament\Resources\Pages\ViewRecord;

class ViewMaterials extends ViewRecord
{
protected static string $resource = MaterialsResource::class;

protected function getHeaderWidgets(): array
{

return[

MaterialsResource\Widgets\MaterialsWidget::class,

];
}

public static function getWidgets(): array
{
return [
MaterialsResource\Widgets\MaterialsWidget::class,
];
}

}
<?php

namespace App\Filament\Resources\MaterialsResource\Pages;

use App\Filament\Resources\MaterialsResource;
use Filament\Actions;
use Filament\Resources\Pages\ViewRecord;

class ViewMaterials extends ViewRecord
{
protected static string $resource = MaterialsResource::class;

protected function getHeaderWidgets(): array
{

return[

MaterialsResource\Widgets\MaterialsWidget::class,

];
}

public static function getWidgets(): array
{
return [
MaterialsResource\Widgets\MaterialsWidget::class,
];
}

}
14 replies
FFilament
Created by Ninja++ on 8/21/2023 in #❓┊help
syntax error, unexpected identifier "Stat", expecting "function" or "const"
This is the page class and the error
View [filament.resources.materials-resource.widgets.materials-widget] not found.
View [filament.resources.materials-resource.widgets.materials-widget] not found.
14 replies