Revision 78 | Revision 80 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed
<?phpnamespace App\Models;use Illuminate\Database\Eloquent\Casts\Attribute;use Illuminate\Database\Eloquent\Factories\HasFactory;use Illuminate\Database\Eloquent\Model;class PriceAgency extends Model{use HasFactory;protected $fillable = ["only_deliverable","min_price","access_url","access_user","access_password","comment","contact_name","contact_email","contact_phone",];protected function lockedManufacturers(): Attribute{return Attribute::make(get: function ( string $value ){if ( $this->shop_id > 1 ){$manufacturer = Manufacturer::setConnection( 'shop' . $this->shop_id );}else{$manufacturer = Manufacturer::setConnection( 'default' );}$manufacturer->whereIn( "id", json_decode( $value, true ) )->get();});}}