i would have the class “opacity” inserted only at the first “carousel-cell”. For the rest in the loop, they should not be there. Answer You could use the $loop->first variable to add a class only on the first iteration of the loop. Like this: <div class=”carousel-cell {{ $loop->first ? ‘opacity’ : ” }}”> See more here: https://laravel.com/docs/9.x/blade#the-loop-variable
Tag: laravel
query laravel not working if pass variable in Where NOT IN
I’m trying to filter items from a database table what I do is get the ids that I want to exclude and then through -> whereNotIn in laravel, I pass the ids up to this point I have no problem. the result of “implode” gives me the ids I want to remove this is the result of $idbike and $notid:
Attempt to assign property of non-object when updating the existing the record
I want to update some records from my table and if user has uploaded a picture, I need to upload it and update the seller_certificate_card as well. Here is my code: And the seller_certificate_card at the table has this structure: seller_certificate_card varchar(255) But I get this error: Attempt to assign property ‘seller_certificate_card’ of non-object So what’s going wrong here? How
Is having an “id” column in a table mandatory to work with BackPack?
I have a table with columns color_id and list_id. When I load a page with that specific model in Laravel BackPack, it throws an error: In general, this is correct. I do not have an id column since it’s a pivot table. I assumed adding custom sorting would solve the problem so I added the following line in my controller’s
Retrieve data from the name of a directory in my database
I use php and laravel. I have a column named MsgBody. In this column, there is an array as follows. I want to get the value of “conversationDesc” from this array. What should I do in the Controller and blade part for this? Answer It seems that your data are JSON. You can decode this using json_decode. You should be
How do I make a factory that creates random titles without a dot at the end?
I am working on a Laravel 8 blogging application. I need a large numer of articles in order to test the pagination. For this purpose, I have made this factory: The problem Unfortunately, the title column in the articles table is populated with sentences that have a dot at the end. Titles are not supposed to end with a dot.
Larave Cache Facade – set vs put
I use Cache::set(…) facade-method for a simple key/value store. But all posts I visit seem to talk about Cache::put(…) method. What is the difference or advantage of one vs the other? Answer set method is same as put As you can see from https://github.com/illuminate/cache/blob/master/Repository.php#L227 – set method delegates all work to put method. set method is added only for compatibility
Extract Json data from a countries.csv file on github, and create a seperate array of timezones
Country.csv this is countries.csv file, and i want to extract all the timezones from it, which is its 14th colomn, and the data in there is not properly json formatted. I’m trying to parse the json but it failed. Actually, I want to create an array of timezones like this what i’m doing, is this in AppHttpControllersTestController::class is this Answer
Image Preview from DB
I’m Trying to Preview images from database as im saving album in table albums and album images in table images and connecting with relation but i can’t preview the images from table image so i’m adding relations between the 2 tables and trying to preview the images but its not working with me something went wrong but i cannot figure
Check if data updated_at 24 hours ago OR a day ago (laravel)
I am able to get days ago for each row in dattable using carbon. (view CustomController.php) But before the user is able to edit the data. I want to check if the data is updated a day ago or 24 hours ago. if 24 hours or a day passed user can’t update the data if it is within 24 hours