Make filename unique for each area, rename column to name/lname for files

This commit is contained in:
2023-06-23 17:33:47 +10:00
parent 0eca20ebdd
commit b8534d8598
4 changed files with 42 additions and 8 deletions

View File

@@ -3,11 +3,9 @@
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\File as FileFacade;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use Rennokki\QueryCache\Traits\QueryCacheable;
@@ -161,7 +159,7 @@ class File extends Model
public function getFullStoragePathAttribute(): string
{
return sprintf('%04X/%s',$this->filearea_id,$this->file);
return sprintf('%04X/%s',$this->filearea_id,$this->name);
}
/* METHODS */