Select All option in relationship Select
Hey, i have a Select with relationship users, works fine but i would like a option to select all users at one
4 Replies
@Leandro Ferreira
i have a bill table and a service table now the bill and services have a many to many relationship. On one bill one service can be taken multiple times like remove of tooth . but when i select one service from the list it disappears and i cant select it multiple times , so i want that i should be able to select one service multiple times
//service model public function bills() : BelongsToMany { return $this->belongsToMany(Bill::class, 'bill_service') ->withTimestamps(); } //Bill Model public function services() : BelongsToMany { return $this->belongsToMany(Service::class, 'bill_service') ->withTimestamps(); } //Bill Resource Forms\Components\Select::make('service_code') ->relationship('services','code') ->multiple() ->reactive() ->preload() ->live() ->required(), @Tin @toeknee
//service model public function bills() : BelongsToMany { return $this->belongsToMany(Bill::class, 'bill_service') ->withTimestamps(); } //Bill Model public function services() : BelongsToMany { return $this->belongsToMany(Service::class, 'bill_service') ->withTimestamps(); } //Bill Resource Forms\Components\Select::make('service_code') ->relationship('services','code') ->multiple() ->reactive() ->preload() ->live() ->required(), @Tin @toeknee
Please read the rules @hashim199 tagging is not permitted.
I really apologize