Adding URL to PRODUCT

This commit is contained in:
2018-09-16 20:32:32 -03:00
parent af0c05f42c
commit be39b48dc3
4 changed files with 37 additions and 12 deletions

View File

@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
protected $fillable = ['user_id', 'name'];
protected $fillable = ['user_id', 'name', 'url'];
public function items()
{
@@ -17,12 +17,4 @@ class Product extends Model
{
return $this->belongsTo(User::class);
}
//Ótima forma de adicionar um item por dentro do produto. Mas não estou usando por não saber como lidar com a table de UsuáriosPorItem
/*
public function addItem($name)
{
$this->items()->create(compact('name'));
}
*/
}