From e5818f13001f4dcd905acac91824d52a15f23480 Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Tue, 18 Dec 2018 22:17:17 +0800 Subject: [PATCH] Update Outlet model docblocks --- app/Outlet.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/app/Outlet.php b/app/Outlet.php index 912b540..f7405c9 100644 --- a/app/Outlet.php +++ b/app/Outlet.php @@ -7,14 +7,29 @@ use Illuminate\Database\Eloquent\Model; class Outlet extends Model { + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'name', 'address', 'latitude', 'longitude', 'creator_id', ]; + /** + * The accessors to append to the model's array form. + * + * @var array + */ public $appends = [ 'coordinate', 'map_popup_content', ]; + /** + * Get outlet name_link attribute. + * + * @return string + */ public function getNameLinkAttribute() { $title = __('app.show_detail_title', [ @@ -28,11 +43,21 @@ class Outlet extends Model return $link; } + /** + * Outlet belongs to User model relation. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ public function creator() { return $this->belongsTo(User::class); } + /** + * Get outlet coordinate attribute. + * + * @return string|null + */ public function getCoordinateAttribute() { if ($this->latitude && $this->longitude) { @@ -40,6 +65,11 @@ class Outlet extends Model } } + /** + * Get outlet map_popup_content attribute. + * + * @return string + */ public function getMapPopupContentAttribute() { $mapPopupContent = '';