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 1 year ago. Improve this question ID Name min_amount charge 1 Standard 50.00 3.00 2 Express 50.00 5.00 3 Standard 100.00 2.00 4 Express 100.00 0.00 so I have this table
Tag: laravel
Laravel/MariaDB: errno 150 “Foreign key constraint is incorrectly formed”
I’m on Laravel 5.4, PHP 5.6, Ubuntu 18.04, MariaDB 10.4.8. When I run php artisan migrate, I get: I’m trying to use https://github.com/klisl/laravel-comments. Before trying to perform a migration with this package I had created DB at phpMyAdmin, had configured .env by adding DB name and stuff, had successfully run php artisan migrate, php artisan make:auth and php artisan make:controller
How to select data using like with out consider after character in laravel or sql
I have a table call labels_table. id label 1 A_1_1 2 A_1_2 3 A_2_1 4 A_4_1 5 A_10_1 6 A_11_1 I need to select all the labels for A_1 group. A_1_1 and A_1_2 should be the correct labels. I used the following query. sql Larval But both SQL and laravel queries returns all A_1_1, A_1_2, A_10_1 and A_11_1. But I
Laravel Migration: Combine multiple values in a new colum
i’m trying to make a migration using Laravel. The idea is to get the values of columns ‘code’ and ‘id’ in different tables, and merge them into a column ‘name’ with ‘-‘ separators. So in part it is a SQL problem. Currently i’m trying something like this. First migration to create the new column ‘name’ (works just fine) And second
How to use the passed data in to a sql query?
How do I pass the $id into my $record SQL query and what is the eloquent query as well? I want to do this because the user_id is the foreign key from borrows. I want to pull data from payment_records that have the same id with the selected id. This is the show method where I passed the id and
Laravel Eloquent Equivalent for MYSQL DISTINCT query multiple columns
Is there an equivalent query for this in eloquent? Answer Try something like this:
Laravel (8.x) Is there a better Eloquent query for this many-to-many filtering problem?
What I have movies many-to-many stars movies many-to-many tags studio one-to-many movies I pass studio name, star name and/or tag name as optional query strings What I need Select all movies with tag and star and studio if all 3 are passed as params Select all movies with tag and star if those 2 are passed as params Select all
How to insert data from one table to another in laravel?
I have two tables, visitors and in. visitors contains columns, Name, Number, Purpose, and Datetime. in contains Name, Number, and InTime. I want to fetch all the values from the visitors table into in. I have tried copying the data from visitors to in, however, if I add new rows into the visitors table, those new rows won’t be reflected
Laravel Eloquent, group by week and display start and end of week
I have the following code, which return a collection of Orders grouped by week. The result is the following, with, Obviously “05” being the week number. But to the proyect i’m currently working this is not the way I want to show it. Is there any way to display or return the week start and week end and not the
Laravel query Builder Select from subquery
I’m trying to convert a sql query to a Laravel Query builder, but i find hard understand which is the best way for FORM SUBQUERY in Laravel, because if i’m not wrong, is not something that you can normally do whit query builder, but you should implement in raw. is this right? and how should translate this? I could translate