Built-in File Manager (#458)

This commit is contained in:
Saeed Vaziry
2025-02-16 19:56:21 +01:00
committed by GitHub
parent 75e554ad74
commit e2b9d18a71
17 changed files with 907 additions and 29 deletions

View File

@ -0,0 +1,32 @@
<?php
namespace Database\Factories;
use App\Models\File;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
class FileFactory extends Factory
{
protected $model = File::class;
public function definition(): array
{
return [
'user_id' => $this->faker->randomNumber(), //
'server_id' => $this->faker->randomNumber(),
'server_user' => $this->faker->word(),
'path' => $this->faker->word(),
'type' => 'file',
'name' => $this->faker->name(),
'size' => $this->faker->randomNumber(),
'links' => $this->faker->randomNumber(),
'owner' => $this->faker->word(),
'group' => $this->faker->word(),
'date' => $this->faker->word(),
'permissions' => $this->faker->word(),
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
];
}
}

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('files', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id');
$table->unsignedBigInteger('server_id');
$table->string('server_user');
$table->string('path');
$table->string('type');
$table->string('name');
$table->unsignedBigInteger('size');
$table->unsignedBigInteger('links');
$table->string('owner');
$table->string('group');
$table->string('date');
$table->string('permissions');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('files');
}
};