<?php namespace App;

use Illuminate\Database\Eloquent\Model;

class Product_img extends Model
{

	public $table    = 'product_imgs';
	public $fillable = ['product_id', 'img_file'];

	public function name()
	{
		return $this->id . $this->img_file;
	}

	public function path()
	{
		return '/uploads/' . $this->product_id . '/' . $this->name();
	}

	public function small(){
		return '/uploads/' . $this->product_id . '/' . $this->id .'_small'. $this->img_file;;
	}
	public function mid(){
		return '/uploads/' . $this->product_id . '/' . $this->id .'_mid'. $this->img_file;;
	}
	public function mini(){
		return '/uploads/' . $this->product_id . '/' . $this->id .'_mini'. $this->img_file;;
	}

}
