:::

2-5 app\Product.php

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Storage;

class Product extends Model
{
    public function getImageUrlAttribute()
    {
        return Storage::disk('public')->url($this->attributes['image']);
    }

    public function carts()
    {
        return $this->hasMany('App\Cart');
    }
}

 


:::

書籍目錄

展開 | 闔起

快速登入


http%3A%2F%2Fcampus-xoops.tn.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D1478%26tbsn%3D44

計數器

今天: 6048604860486048
昨天: 8625862586258625
總計: 8036655803665580366558036655803665580366558036655