|Newsroom newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Newsroom newQuery() * @method static \Illuminate\Database\Eloquent\Builder|Newsroom query() * @method static \Illuminate\Database\Eloquent\Builder|Newsroom whereAuthOnly($value) * @method static \Illuminate\Database\Eloquent\Builder|Newsroom whereBody($value) * @method static \Illuminate\Database\Eloquent\Builder|Newsroom whereBodyRendered($value) * @method static \Illuminate\Database\Eloquent\Builder|Newsroom whereCategory($value) * @method static \Illuminate\Database\Eloquent\Builder|Newsroom whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Newsroom whereForceModal($value) * @method static \Illuminate\Database\Eloquent\Builder|Newsroom whereHeaderPhotoUrl($value) * @method static \Illuminate\Database\Eloquent\Builder|Newsroom whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|Newsroom whereLink($value) * @method static \Illuminate\Database\Eloquent\Builder|Newsroom wherePublishedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Newsroom whereShowLink($value) * @method static \Illuminate\Database\Eloquent\Builder|Newsroom whereShowTimeline($value) * @method static \Illuminate\Database\Eloquent\Builder|Newsroom whereSlug($value) * @method static \Illuminate\Database\Eloquent\Builder|Newsroom whereSummary($value) * @method static \Illuminate\Database\Eloquent\Builder|Newsroom whereTitle($value) * @method static \Illuminate\Database\Eloquent\Builder|Newsroom whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Newsroom whereUserId($value) * @mixin \Eloquent */ class Newsroom extends Model { protected $table = 'newsroom'; protected $guarded = []; protected function casts(): array { return [ 'published_at' => 'datetime', ]; } public function permalink() { $year = $this->published_at->year; $month = $this->published_at->format('m'); $slug = $this->slug; return url("/site/newsroom/{$year}/{$month}/{$slug}"); } public function editUrl() { return url("/i/admin/newsroom/edit/{$this->id}"); } }