SQLSTATE[01000]: Warning: 1265 Data truncated for column

SQLSTATE[01000]: Warning: 1265 Data truncated for column ‘pay_totals’ at row 1 public function order(Request $req){ $order = new Order; $order->pay_number = $req->…

Get most recent row with group by and Laravel

Even though there are multiple questions like this I can’t get my query to return the row with the most recent date with a group by. I have the following table.. | message_id | from | to | …

Laravel 5 Eloquent where and or in Clauses

i try to get results from table with multiple where and/or clauses. My SQL statement is: SELECT * FROM tbl WHERE m__Id = 46 AND t_Id = 2 AND (Cab = 2 OR Cab = 4) How i can get this with Laravel …

two foreign keys, how to map with laravel eloquent

I have two tables in MySQL, where the first one is called users and the second one is called games. The table structure is as follows. users id (primary) email password real_name games id (Primary)…

Laravel foreign key onDelete(‘cascade’) not working

I have a many-to-many relationship between User & Role, with a role_user table. My migrations are setup as so (simplified): users table: public function up() { Schema::create(‘users’, …