i have posts table and related with likes table ,comments table and shares table i use to get posts order by likes count . ِAny Suggesstion ? Answer You can use orderByRaw method
Tag: laravel
how to enter data into an array with a loop. laravel
I want to insert data from the database into an array that can be increased in number. So maybe you can use a loop but the data is stacked, not added and returns the last data i am trying to use for with $i++ to generate $variable.$i. that’s what I was expecting but I don’t understand how to run it
Laravel 9: Numeric value out of range: 1264 Out of range value for column ERROR
I’m working with Laravel 9 and I have used this column at users table for storing user mobile phone number: And at the factor, I tried this to fill out this column: But when I run php artisan db:seed, I get this error: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column ‘usr_mobile_phone’ at row 1
how to loop and array to create a TABLE in laravel with phpdocx
I am using phpdocx to generate an array with my data in a docx format. $contact is an array of multiple object. Sometimes $contact contain 1 object, and sometimes more. I want to make a loop, to add contact as much as I need. My problem : For exemple, If I am doing this I will get an error like
I am always getting an error everytime i try to add data in db: SQLSTATE[42703]: Undefined column: 7 ERROR: column
So, theres already a pre-made table in the database. Now, I am trying to connect my project to that specific table in the db. but everytime i try to insert data, im getting this error “SQLSTATE[42703]: Undefined column: 7 ERROR: column “updated_at” of relation “applicant_account_tbl” does not existnLINE 1: …”, “last_name”, “birthdate”, “email”, “password”, “updated_a…n ^ (SQL: insert into “applicant_account_tbl”
How can I use 3 group by in one query statement sql? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 days ago. Improve this question This is my query.Group by query in one table and I wanna get three sum column in select statement This is my table This is
Laravel – query part of a integer and boolean value
In my database I have id column which can contain integer, string, integer + string value. like, check this image: https://ibb.co/2KNJzVW As you can see on the id column I have something like this value: product id PPAETRABN018283 So, On the input box (my search form) – If I enter product I can get the result as there is product
Laravel Passport Grant Token — Set custom username and password fields
I am working on project which has separate model for users — AppModelsCustomer. And also it has own authorisation fields — Email and cust_password. And also password is hashed by password_hash function. In my config/auth.php in providers section I set up my custom model: So I am trying to implement Laravel Grand Tokens. I need to make request to /oauth/token/
Pass variable to view via controller in Laravel
I need help with passing the variable I have initialized using __construct() to view in Laravel. Here is my controller code I get an error undefined variable profileInfo Answer When using compact() the parameters used must be defined as variables: In this case compact() will create an array like this:
Adding subfolders to zip file in php (laravel)
I have a function which is working fine to create zip file from folder files. But recently I’ve had need to add sub-folders into my main folder and now I see my function does not add those sub-folders and files in them into generated zip file. here is what I have currently: By using code above, let say I have