There is a filter called SlotRoom one of its method is options
public function options(Request $request)
{
/** @var Model $models */
$roomModel = app('room');
return $roomModel->pluck('id', 'name')->all();
}
If I call this filter, from the class Booking in the Booking package... got 500 error

the problem here is the name because the current table rooms has no column called name, currently is build it
public function getNameAttribute()
{
// Check if the location has multiple rooms with same theme. Will need to edit later for accurate count.
if (self::where('location_id', $this->location_id)->where('escaperoom_theme_id', $this->escaperoom_theme_id)->count() > 1) {
return "{$this->location->abbreviation} {$this->theme->name} #{$this->id}";
}
// If only room at the location with the theme, return theme title
return "{$this->location->abbreviation} {$this->theme->name}";
}
Two possible solutions here to solved this issue:
1 - add a new migration adding the column name add fill its value with the logic made in getNameAttribute
2 - change the logic in the option method, (Complex)
In addition, I think this filter should be moving to the escape-room package
@joshtorres @drewroberts
There is a filter called
SlotRoomone of its method isoptionsIf I call this filter, from the class
Bookingin the Booking package... got 500 errorthe problem here is the
namebecause the current tableroomshas no column calledname, currently is build itTwo possible solutions here to solved this issue:
1 - add a new migration adding the column
nameadd fill its value with the logic made ingetNameAttribute2 - change the logic in the option method, (Complex)
In addition, I think this filter should be moving to the
escape-roompackage@joshtorres @drewroberts