<?php

namespace App\Models\Graphics;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Clipart_colourway extends Model
{
    use SoftDeletes;
    /**
     * Don't auto-apply mass assignment protection.
     *
     * @var array
     */
    protected $guarded = [];

    // explicitly define tables
    protected $table = 'clipart_colourways';

    protected $fillable = [
        'clipart_id', 'data','colour','colour_name'
    ];

    public function clipart()
    {
        return $this->hasOne('App\Models\Graphics\Clipart', 'id', 'clipart_id');
    }

    public function path()
    {
        return \url('/colourway') . '/' . $this->id;
    }
}
