Changeset c6b84df for app/Models


Ignore:
Timestamp:
10/21/21 23:45:59 (3 years ago)
Author:
beratkjufliju <kufliju@…>
Branches:
develop, master
Children:
4b7e2d3
Parents:
6b95845
Message:

added fileTypes controller, notifications, excel export, edited views

Location:
app/Models
Files:
1 added
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • app/Models/Department.php

    r6b95845 rc6b84df  
    2525    }
    2626
    27     public function document(){
    28         return $this->hasMany(Document::class);
     27    public function folder(){
     28        return $this->hasMany(Folder::class);
    2929    }
    3030}
  • app/Models/File.php

    r6b95845 rc6b84df  
    1111    protected $fillable = ["name", "location", "document_id"];
    1212
    13     public function document()
     13    public function folder()
    1414    {
    15         return $this->belongsTo(Document::class);
     15        return $this->belongsTo(Folder::class);
    1616    }
    1717
    1818    public function getSize($location)
    1919    {
    20         $fileSize = Storage::disk('local')->size($location) / 1024 / 1024;
     20        $fileSize = Storage::disk('uploads')->size($location) / 1024 / 1024;
    2121        $fileSize = round($fileSize, 2);
    2222        return $fileSize;
  • app/Models/Folder.php

    r6b95845 rc6b84df  
    66use Illuminate\Database\Eloquent\Model;
    77
    8 class Document extends Model
     8class Folder extends Model
    99{
    1010    use HasFactory;
    11     protected $table = "documents";
     11    protected $table = "folders";
    1212
    13     protected $fillable = ["arch_id", "name", "description", "user_id", "department_id", "is_important"];
     13    protected $fillable = ["arch_id", "name", "description", "location", "user_id", "department_id", "is_important"];
    1414
    1515
  • app/Models/User.php

    r6b95845 rc6b84df  
    2424        "surname",
    2525        "username",
     26        "phone_number",
     27        "email",
    2628        "password",
    27         "email",
    28         "phone_number",
    2929        "avatar",
    3030        "role_id"
Note: See TracChangeset for help on using the changeset viewer.