Seebad 0.3 stays in this release. With a single landlord every host still reaches the default website. Co-authored-by: Cursor <cursoragent@cursor.com>
41 lines
985 B
PHP
41 lines
985 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Concerns\BelongsToTenant;
|
|
use Database\Factories\FaqFactory;
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Attributes\Scope;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
#[Fillable(['question', 'answer', 'is_published', 'sort_order'])]
|
|
class Faq extends Model
|
|
{
|
|
/** @use HasFactory<FaqFactory> */
|
|
use BelongsToTenant, HasFactory;
|
|
|
|
/**
|
|
* Get the attributes that should be cast.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'is_published' => 'boolean',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @param Builder<Faq> $query
|
|
* @return Builder<Faq>
|
|
*/
|
|
#[Scope]
|
|
protected function published(Builder $query): Builder
|
|
{
|
|
return $query->where('is_published', true)->orderBy('sort_order');
|
|
}
|
|
}
|