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
|
|
|
|
2023-02-07 02:45:15 +01:00
|
|
|
use App\Nami\HasNamiField;
|
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;
|
2023-02-07 02:45:15 +01:00
|
|
|
use HasNamiField;
|
2021-11-18 01:54:27 +01:00
|
|
|
|
|
|
|
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
|
|
|
}
|