:::

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');
    }
}

 


:::

書籍目錄

展開 | 闔起

https%3A%2F%2Fcampus-xoops.tn.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbsn%3D44%26tbdsn%3D1478

計數器

今天: 545545545
昨天: 2359235923592359
總計: 7977643797764379776437977643797764379776437977643