You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
There is a filter called
SlotRoom
one of its method isoptions
If I call this filter, from the class
Booking
in the Booking package... got 500 errorthe problem here is the
name
because the current tablerooms
has no column calledname
, currently is build itTwo possible solutions here to solved this issue:
1 - add a new migration adding the column
name
add fill its value with the logic made ingetNameAttribute
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
The text was updated successfully, but these errors were encountered: