Changeset ea7b12a for app/Models/File.php
- Timestamp:
- 10/19/21 17:46:21 (3 years ago)
- Branches:
- develop, master
- Children:
- 6b95845
- Parents:
- b9c4a92
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Models/File.php
rb9c4a92 rea7b12a 4 4 5 5 use Illuminate\Database\Eloquent\Model; 6 use Illuminate\Support\Facades\Storage; 6 7 7 8 class File extends Model 8 9 { 9 10 protected $table = "files"; 10 protected $fillable = [" link", "document_id"];11 protected $fillable = ["name", "location", "document_id"]; 11 12 12 13 public function document() … … 14 15 return $this->belongsTo(Document::class); 15 16 } 17 18 public function getSize($location) 19 { 20 $fileSize = Storage::disk('local')->size($location) / 1024 / 1024; 21 $fileSize = round($fileSize, 2); 22 return $fileSize; 23 } 16 24 }
Note:
See TracChangeset
for help on using the changeset viewer.