Skip to content

Tag: laravel-blade

check in blade if exists variable in @include

I´m developping a system with laravel 7.4 and i need check if one variable that i´m sending from my controller exists in my blade. If exists, include it: I have this code in my controller: this return profile image or system image but it´s possible that this images don´t exists and i need check before, becaus…

how to limiting word on the laravel blade?

I’m looking to find out how to limit word in laravel blade. I’ve coded using substr, but it’s still not working properly. Can anyone help me? Answer The Str::words method limits the number of words in a string. An additional string may be passed to this method via its third argument to speci…

Format number in array within an array_sum

I have a view in a laravel project where I have to print the sum of some array columns. I Have this kind of code to achieve the result: It works fine. But there is a problem. The numeric columns have a formatted italian currency number like this: 1.267,76 € So the sum is printed wrong, because numbers have wr…

Laravel Multilayered groupBy

Assume we have this record: While assuming we have this code in our DummyController: And lastly, assuming we have @foreach ($dummyRecord as $dummy_column_name => $dummy) inside our index.blade, we could display the result as such: But I want to display the relation 4’s record of color as a div inside…

Values Not Updated in Database

I have a product attribute table, in that, I have 2 text fields. So when I enter the values in all text field box. And when I press the update button. the first input row is updated successfully but the others not. Here is the picture of the blade file: Here is my code Blade.php ProductsController.php Answer …

Laravel destroy nested resource

I have a resource name OrganizationEmailDomain and able to index it just fine In that view, when clicking in the three dots there’s the destroy part If in that index view I echo $email_domains (<?php echo $email_domains;?>) then I get as expected (note that the following was before the images were…