This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

thiago9438
thiago9438

Hi, my model is:

<?php namespace Fonix\Parceiros\Models;

use Model;

 *
* Parceiro Model

class Parceiro extends Model
{

 *
* @var string The database table used by the model.

    public $table = 'fonix_parceiros_parceiro';

 *
* @var array Guarded fields

    protected $guarded = ['*'];

 *
* @var array Fillable fields

    protected $fillable = [];

    public $attachOne = [
        'thumb' => ['System\Models\File']
    ];

    public function getThumbAttribute()
    {
        $model = $this->find($this->id);
        return '<img src="'.$model->thumb->getPath().'" />';
    }

 *
* @var array Relations

    public $hasOne = [];
    public $hasMany = [];
    public $belongsTo = [];
    public $belongsToMany = [];
    public $morphTo = [];
    public $morphOne = [];
    public $morphMany = [];

    public $attachMany = [];

}

And my columns.yaml:

=================================== List Column Definitions

columns:
    name:
        label: Nome
        searchable: true

    link:
      label: Link

    thumb:
      label: Thumb

But, when i go to list page, he takes to load, and when it ends, the error on the page:

ERR_CONNECTION_RESET

From what I saw, the problem is on: return ''; specifically: thumb->getPath().

Last updated

1-1 of 1

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.