Laravel 8. I have two tables(models) 'employees' and 'positions'. In a model 'employees' I have a casts: protected $casts = [ 'academic_post' => 'array'
Laravel 5.7 Hello I have been looking through stack overflow and have tried many possible answers and have come to no conclusions. I am updating a simple inte
My query from Laravel Builder toSql() function. select `dispatcher_leads`.*, (select CASE WHEN lead_positions.order_type = 'shift' THEN DATE_ADD(lead_positions
In Laravel I have got this error, while inserting a record in my MongoDB database. Call to a member function prepare() on null namespace App\Http\Controllers;
i use mutator in my model to encrypt id: public function getIdAttribute($value) { return encrypt($value); } but I want the default value to be the original
I have been trying to update the timeout for a given user_id, logdate, and status but my update statement is not working or may be my other if else are not corr
Recently I just realized that Laravel generates a static method with column name when joined in a where clause using camel case example $user = User::whereN
Laravel 3 Table table_user id name table_barang id iduser name statusbarang_id table_statusbarang id name My code UserModels: public function BarangModels()
I am making a schedule display system and it shows the schedules of ferries. my problem is if I dont put midnight time in order then query skips midnight time a
I use mongodb and mysql together with Laravel. Fields table in mysql database can have more options in mysql database. fields table in mysql: id, name options
The code below works perfectly and displays all products with discounts in JSON Format for my API. But I want the result ordered by id in the discounts table. S
I'm having an issue in a Laravel Zero project I'm working on. I'm working on a command that handles direct file transfers between 2 disks—1 SFTP and anoth
I need to get all the rows on my database that meet some criteria. One those criteria is to not be older than 24 hours. I've been trying different solutions pos
I'm trying to print {{$day->date}} in a view. Instead of full date YYYY-MM-DD the property only returns year YYYY. Can anyone explain me why it is working li
I'm new to laravel and I want to submit a form which have three attachments plus some arrays but when I click submit button laravel says "The POST method
I've an enum field in my migration. The code is here: Schema::create('clients', function (Blueprint $table) { $table->increments('id'); $ta
I'm struggling to sort an Eloquent collection using the sortBy() method. The issue is that the sorting is case sensitive and it first retrieves the uppercase re
I am working on a Laravel 5.7 based project in which Eloquent is used as an ORM. I need to execute a raw SQL statement on my database. Howev
I've a fetch a Laravel Eloquent collection by: $product = Product::query()->with(['merchant', 'picture'])->where('id', $id)->first(); and get the du
I often find it very useful to index my results by the primary key id. Example: $out = []; $users = User::where('created_at', '>=', '2015-01-01')->get(