adrema/app/Course/Models/Course.php

24 lines
488 B
PHP
Raw Normal View History

2021-11-18 01:54:27 +01:00
<?php
2021-11-19 22:58:27 +01:00
namespace App\Course\Models;
2021-11-18 01:54:27 +01:00
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Course extends Model
{
use HasFactory;
public $timestamps = false;
2021-11-19 22:58:27 +01:00
public $fillable = ['name', 'nami_id'];
2022-11-22 00:37:34 +01:00
public function getShortNameAttribute(): string
{
return str($this->name)
->trim()
->replaceFirst('Baustein', '')
->trim()
->replaceMatches('/ - .*/', '');
}
2021-11-18 01:54:27 +01:00
}