skip to Main Content

Bug with Laravel Eloquent query buldier

I found a weird situation when nesting in a query a where with a orWhereNull. The result is returning rows with values that are neither null nor correct This is the code: $query = Document::where("active", true)->where("type_id", $document_type->id); if($selected) { $query->where(function($q)…

VIEW QUESTION

Laravel 11 – validated() and related table

I'd like to insert the user-id of the current user into a table in column "user_id". The field is a relation to the user table. Migration / database schema Schema::create('pdlocations', function (Blueprint $table) { $table->id(); $table->timestamps(); $table->decimal('lon', 10, 7); $table->decimal('lat',…

VIEW QUESTION
Back To Top
Search