skip to Main Content

Combing multiple orWhere() in Laravel 9 Eloquent

Is it possible to combine multiple orWhere() inside one where()? E.g. The following: $query->where(function($query){ $query->where('text1', '=', $_GET['lorem']) ->orWhere('text2', '=', $_GET['lorem']) ->orWhere('text3', '=', $_GET['lorem']) ->orWhere('text4', '=', $_GET['lorem']); }); Would look something like this: $query->where(function($query){ $query->where(['text1' || 'text2' || 'text3' || 'text4'],…

VIEW QUESTION

What is wrong with this form validation – Laravel

I'm working with Laravel 5.8 and I have made this Controller method for creating some records inside the DB. public function doTheUpload(Request $request) { try{ $request->validate([ 'video' => 'nullable|mimes:mp4', 'video_thumb' => 'required|mimes:jpg,png,jpeg', 'video_name' => 'required', 'video_desc' => 'nullable', 'available_download' =>…

VIEW QUESTION

How to send a primary key as a foreign key to another table while submitting the form in Laravel vue?

I have these 2 tables: Table one(parties): public function up() { Schema::create('parties', function (Blueprint $table) { $table->id(); $table->string('full_name'); $table->string('ic_passport'); $table->string('nationality'); $table->string('income_tax_no'); $table->string('income_Tax_filing_branch'); $table->string('phone_no'); $table->string('email'); $table->timestamps(); }); } Table two(corraddresses): public function up() { Schema::create('corraddresses', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('party_id');…

VIEW QUESTION
Back To Top
Search