mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 20:14:45 +00:00
feat: add s3 storages
This commit is contained in:
1 parent
2a7e7e978b
commit
f6e888ecf9
24 files changed
+916
-35
No files matched your search
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class S3Storage extends BaseModel
|
||||
{
|
||||
use HasFactory;
|
||||
protected $guarded = [];
|
||||
|
||||
static public function ownedByCurrentTeam(array $select = ['*'])
|
||||
{
|
||||
$selectArray = collect($select)->concat(['id']);
|
||||
return S3Storage::whereTeamId(session('currentTeam')->id)->select($selectArray->all())->orderBy('name');
|
||||
}
|
||||
public function awsUrl() {
|
||||
return "{$this->endpoint}/{$this->bucket}";
|
||||
}
|
||||
public function testConnection() {
|
||||
set_s3_target($this);
|
||||
return \Storage::disk('custom-s3')->files();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user