skip to Main Content

Calling laravel controller inside a route

I've Laravel route with GET & POST as below Route::get("test1","ApiTestController@test1"); Route::post("test1","ApiTestController@test1"); Now I'm trying to check some condition & if it remain true then I want to call controller else i want to show error without even going into controller.…

VIEW QUESTION

Laravel 8.x realationship – Use HasMany in HasOne

I'm trying to use a HasMany relation in a HasOne. I have following Models: class Auction extends Model { //... public function bids(): HasMany { return $this->hasMany(Bid::class, 'auction_id'); } public function approvedBids(): HasMany { return $this->bids()->approved(); } public function topBids():…

VIEW QUESTION

update content of stored column in laravel controller

I have a table with 3 columns: firstname lastname fullname in migration: Schema::create('owners', function (Blueprint $table) { $table->id(); $table->string('firstname',20); $table->string('lastname', 20); $table->string('fullname')->storedAs('CONCAT(firstname,lastname)'); $table->timestamps(); }); the problem is that i want to change the concatenation order in the controller i tried…

VIEW QUESTION
Back To Top
Search