Skip to content
Advertisement

Tag: laravel

Add class only on first carousel-cell (flickity)

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

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

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

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

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

Advertisement