class SOProperty extends Model
{
protected $fillable = [
'city', 'postal_code', 'address_1', 'address_2', 'street', 'description', 'avatar',
'photo_1', 'photo_2', 'photo_3', 'photo_4', 'photo_5'
];
protected $casts = [
'business_hours' => 'array',
];
protected $appends = ['photo1'];
public function getPhoto1Attribute($value)
{
return 'test';
}
public function getAvatarAttribute($value)
{
return 'test';
}
public function getAddress1Attribute($value)
{
return 'test';
}
}
public function index()
{
$salonOwners = User::where('role', UserRoles::SO)->with('SOProfile')->get();
return response()->json(['success' => $salonOwners], 200);
}
public function SOProfile()
{
return $this->hasOne(SOProperty::class);
}
class SOProperty extends Model
{
protected $fillable = [
'city', 'postal_code', 'address_1', 'address_2', 'street', 'description', 'avatar',
'photo_1', 'photo_2', 'photo_3', 'photo_4', 'photo_5'
];
protected $casts = [
'business_hours' => 'array',
];
public function getPhoto1Attribute($value)
{
return 'test';
}
public function getAvatarAttribute($value)
{
return 'test';
}
public function getAddress1Attribute($value)
{
return 'test';
}
}