Initial commit - Physiotherapy Clinic Management System
This commit is contained in:
commit
dbb326f2cc
300 files changed
+144285
No files matched your search
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class ReminderTemplate extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'content',
|
||||
'channel',
|
||||
'hours_before',
|
||||
'is_active',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'hours_before' => 'integer',
|
||||
'is_active' => 'boolean',
|
||||
];
|
||||
|
||||
public function reminders(): HasMany
|
||||
{
|
||||
return $this->hasMany(Reminder::class, 'template_id');
|
||||
}
|
||||
|
||||
public function parseContent(array $placeholders): string
|
||||
{
|
||||
$content = $this->content;
|
||||
foreach ($placeholders as $key => $value) {
|
||||
$content = str_replace('{' . $key . '}', $value, $content);
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user