leoPascal
leoPascal
FFilament
Created by leoPascal on 12/2/2023 in #❓┊help
Please Help! Is it possible to show the images based on the selected option in create form?
Thank you for your reply, @Alex Six . I'm trying to do like this
class Counter extends Component
{
public $orderDtls = [];

public function addNewItem()
{
$this->orderDtls[] = [
'item_quantity' => 0,
'item_cost' => 0,
'item_total' => 0,
];
}

public function updated($key)
{
foreach ($this->orderDtls as $index => $item) {
$this->orderDtls[$index]['item_total'] = $item['item_quantity'] * $item['item_cost'];
}
}

public function render()
{
return view('livewire.counter');
}
}
class Counter extends Component
{
public $orderDtls = [];

public function addNewItem()
{
$this->orderDtls[] = [
'item_quantity' => 0,
'item_cost' => 0,
'item_total' => 0,
];
}

public function updated($key)
{
foreach ($this->orderDtls as $index => $item) {
$this->orderDtls[$index]['item_total'] = $item['item_quantity'] * $item['item_cost'];
}
}

public function render()
{
return view('livewire.counter');
}
}
the blade view like this
<div>
@foreach($orderDtls as $key => $item)
<div>
<label for="item_quantity">Item Quantity:</label>
<input name="item_quantity" wire:model.lazy="orderDtls.{{ $key }}.item_quantity" type="number" min="0" class="text-gray-700 text-sm border-b border-gray-400 focus:outline-none">
<label for="item_cost">Item Cost:</label>
<p class="text-gray-700 text-sm">{{ $linked->item_cost }}</p>
<h1>Total: {{ $item['item_total'] }}</h1>
</div>
@endforeach
<button wire:click="addNewItem">Add Item</button>
</div>
<div>
@foreach($orderDtls as $key => $item)
<div>
<label for="item_quantity">Item Quantity:</label>
<input name="item_quantity" wire:model.lazy="orderDtls.{{ $key }}.item_quantity" type="number" min="0" class="text-gray-700 text-sm border-b border-gray-400 focus:outline-none">
<label for="item_cost">Item Cost:</label>
<p class="text-gray-700 text-sm">{{ $linked->item_cost }}</p>
<h1>Total: {{ $item['item_total'] }}</h1>
</div>
@endforeach
<button wire:click="addNewItem">Add Item</button>
</div>
here all the item_images are getting displayed. the functionality what I need is like I want to display the item_quantity, item_cost & item_total when the item_quantity got updated I want the item_total to be updated automatically for each item. PLEASE HELP ME ACHIEVE THIS!
8 replies
FFilament
Created by leoPascal on 12/2/2023 in #❓┊help
Please Help! Is it possible to show the images based on the selected option in create form?
Thank you @Alex Six for your prompt response. It seems like the suggested solution will work, except for one crucial aspect – handling images. I specifically need to display images within the form. Allow me a moment to elaborate on my requirements. I have approximately 1000 item images associated with around 5 customers, each with different prices based on the customer. For instance: item-1 = $1 for Customer-A item-2 = $2 for Customer-A item-1 = $1.5 for Customer-B item-2 = $1.75 for Customer-B item-1 = $1.8 for Customer-C item-2 = $2.25 for Customer-C ... and so forth On the orders page, I aim to initially load a select field with all customers. Upon selecting an option, I want the corresponding item images to be displayed in a separate card for each item with 3 placeholders for supplier_barcode, item_cost, item_total (item_cost * item_quantity) and an input field for item_quantity. Finally, at the bottom of the page, I need to display the total amount, similar to a cart. I appreciate your assistance.
8 replies
FFilament
Created by leoPascal on 12/2/2023 in #❓┊help
Please Help! Is it possible to show the images based on the selected option in create form?
Is there anyone who can help, please.
8 replies
FFilament
Created by Jamie Cee on 11/22/2023 in #❓┊help
Empty Image
the 'APP_URL' in the project .env file must be same as the actaul url, for example if the url in the browser is "http://127.0.0.1.." then .env must have the same as 'APP_URL'.
50 replies
FFilament
Created by leoPascal on 12/2/2023 in #❓┊help
Is it possible to generate barcode in filament?
really, I never checked that. I will definetly give it a try. Thank you so very much once again for your kind assistance.
12 replies
FFilament
Created by leoPascal on 12/2/2023 in #❓┊help
Is it possible to generate barcode in filament?
superb! 👍
12 replies
FFilament
Created by leoPascal on 12/2/2023 in #❓┊help
Is it possible to generate barcode in filament?
sorry, but how can I display the number at the bottom of this barcode?
12 replies
FFilament
Created by leoPascal on 12/2/2023 in #❓┊help
Is it possible to generate barcode in filament?
wow! thank you so much & GOD bless you @Lara Zeus . it works like a charm.
12 replies
FFilament
Created by leoPascal on 11/17/2023 in #❓┊help
I want to hide 2 widgets out of 4 from my resource page on dashboard, is it possible to do that?
Appologies for late reply! Yes all 4 widgets getting getting displaying, both on the dashboard and the resource page.
7 replies
FFilament
Created by leoPascal on 11/17/2023 in #❓┊help
I want to hide 2 widgets out of 4 from my resource page on dashboard, is it possible to do that?
thanks for your reply @Leandro Ferreira I tried like this because ->isAdmin gives me error. But this canView() hide all 4 widgets from the dashboard & resource page aswell.
public static function canView():bool
{
if(\auth()->user()->can('show_widgets')){
return true;
}
else{
return false;
}
}
public static function canView():bool
{
if(\auth()->user()->can('show_widgets')){
return true;
}
else{
return false;
}
}
I actually want to show all 4 widgets on my resource page and show only 2 on dashboard.
7 replies
FFilament
Created by leoPascal on 11/8/2023 in #❓┊help
is it possible to have ToggleColumn with text in filament v2?
sorry, it was my mistake. I need to enable the zip extension in php --ini and did that. I think it should work now, thanks though.
10 replies
FFilament
Created by leoPascal on 11/8/2023 in #❓┊help
is it possible to have ToggleColumn with text in filament v2?
by the way, I'm using filament V2.
10 replies
FFilament
Created by leoPascal on 11/8/2023 in #❓┊help
is it possible to have ToggleColumn with text in filament v2?
hey VP do you have any idea why I'm getting this error while tyring to use Dennis Excel Pluging composer require pxlrbt/filament-excel Error Installation failed, reverting ./composer.json and ./composer.lock to their original content.
10 replies
FFilament
Created by leoPascal on 11/8/2023 in #❓┊help
is it possible to have ToggleColumn with text in filament v2?
Great! that works well, thank you so much @Vp .
10 replies
FFilament
Created by leoPascal on 11/8/2023 in #❓┊help
is it possible to have ToggleColumn with text in filament v2?
No description
10 replies
FFilament
Created by leoPascal on 10/9/2023 in #❓┊help
how can I insert the placeholder value into database?
thank you for your reply @Vp . yeah TextInput works fine.
7 replies
FFilament
Created by leoPascal on 9/20/2023 in #❓┊help
how can I hide a form field which is $fillable in the model.
@alexandergaal no issues at all, whenever you have time. Thank you so much.
61 replies
FFilament
Created by leoPascal on 9/20/2023 in #❓┊help
how can I hide a form field which is $fillable in the model.
@alexandergaal Please check, if you can help with this 👆 .
61 replies
FFilament
Created by leoPascal on 9/20/2023 in #❓┊help
how can I hide a form field which is $fillable in the model.
If you guys have a moment, could you please take a look at another question I posted last week https://discord.com/channels/883083792112300104/1150702532457414656 ? It hasn't received a response yet, and I would really appreciate your help with it."
61 replies
FFilament
Created by leoPascal on 9/20/2023 in #❓┊help
how can I hide a form field which is $fillable in the model.
@alexandergaal , @Vp thank you guys once again for your kind help.
61 replies