Upgrade to Laravel 13
This commit is contained in:
parent
e8e2bff5e4
commit
9f012b01e4
117 changed files with 1878 additions and 2215 deletions
|
|
@ -4,22 +4,20 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Attributes\Table;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
#[Table('media_endpoint')]
|
||||
#[Fillable(['token', 'path', 'type', 'image_widths'])]
|
||||
class Media extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/** @var string */
|
||||
protected $table = 'media_endpoint';
|
||||
|
||||
/** @var array<int, string> */
|
||||
protected $fillable = ['token', 'path', 'type', 'image_widths'];
|
||||
|
||||
public function notes(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Note::class)
|
||||
|
|
@ -35,7 +33,7 @@ class Media extends Model
|
|||
return $attributes['path'];
|
||||
}
|
||||
|
||||
return config('app.url') . '/storage/' . $attributes['path'];
|
||||
return config('app.url').'/storage/'.$attributes['path'];
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -80,7 +78,7 @@ class Media extends Model
|
|||
$basename = $this->getBasename($path);
|
||||
$extension = $this->getExtension($path);
|
||||
|
||||
return config('app.url') . '/storage/' . $basename . '-' . $size . '.' . $extension;
|
||||
return config('app.url').'/storage/'.$basename.'-'.$size.'.'.$extension;
|
||||
}
|
||||
|
||||
private function getBasename(string $path): string
|
||||
|
|
@ -91,7 +89,7 @@ class Media extends Model
|
|||
array_pop($filenameParts);
|
||||
|
||||
return ltrim(array_reduce($filenameParts, static function ($carry, $item) {
|
||||
return $carry . '.' . $item;
|
||||
return $carry.'.'.$item;
|
||||
}, ''), '.');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue