Skip to content
Advertisement

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, because i have error in

How to solve the @json Blade directive red underline on VSC?

This variables are working perfectly, I wonder why are they with a red underline. Anyone knows how to correct this? Error msg Answer Since VSCode doesn’t ship intellisense for [blade] template files in default, we need to install extra extensions for correct grammar checking and snippets support for .blade.php files. Here are some of them onecentlin.laravel-blade * works best for

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 specify which string should be appended to the

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 wrong

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 a div, which makes the final output look like this

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 Upgrade your ProductsController.php

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 added, so the records don’t match the images) When

Advertisement