You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.1 KiB
PHP
47 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
class ProcesoAdmisionDetalle extends Model
|
|
{
|
|
protected $table = 'proceso_admision_detalles';
|
|
|
|
protected $fillable = [
|
|
'proceso_admision_id',
|
|
'tipo',
|
|
'titulo_detalle',
|
|
'descripcion',
|
|
'listas',
|
|
'meta',
|
|
'url',
|
|
'imagen_path',
|
|
'imagen_path_2',
|
|
];
|
|
|
|
protected $casts = [
|
|
'listas' => 'array',
|
|
'meta' => 'array',
|
|
];
|
|
|
|
protected $appends = ['imagen_url','imagen_url_2'];
|
|
|
|
public function proceso(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ProcesoAdmision::class, 'proceso_admision_id');
|
|
}
|
|
|
|
public function getImagenUrlAttribute(): ?string
|
|
{
|
|
return $this->imagen_path ? Storage::disk('public')->url($this->imagen_path) : null;
|
|
}
|
|
|
|
public function getImagenUrl2Attribute(): ?string
|
|
{
|
|
return $this->imagen_path_2 ? Storage::disk('public')->url($this->imagen_path_2) : null;
|
|
}
|
|
}
|