You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
661 B
31 lines
661 B
<?php
|
|
|
|
namespace App;
|
|
|
|
use App\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Outlet extends Model
|
|
{
|
|
protected $fillable = [
|
|
'name', 'address', 'latitude', 'longitude', 'creator_id',
|
|
];
|
|
|
|
public function getNameLinkAttribute()
|
|
{
|
|
$title = __('app.show_detail_title', [
|
|
'name' => $this->name, 'type' => __('outlet.outlet'),
|
|
]);
|
|
$link = '<a href="'.route('outlets.show', $this).'"';
|
|
$link .= ' title="'.$title.'">';
|
|
$link .= $this->name;
|
|
$link .= '</a>';
|
|
|
|
return $link;
|
|
}
|
|
|
|
public function creator()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|