* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0 */ namespace App\Models; use App\Traits\Auditable; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Ban extends Model { use Auditable; use HasFactory; /** * The attributes that aren't mass assignable. * * @var string[] */ protected $guarded = ['id', 'created_at', 'updated_at']; /** * Belongs To A User. */ public function banneduser(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(User::class, 'owned_by')->withDefault([ 'username' => 'System', 'id' => '1', ]); } /** * Belongs To A User. */ public function staffuser(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(User::class, 'created_by')->withDefault([ 'username' => 'System', 'id' => '1', ]); } }