Add video platform features: authentication, video management, user profiles, likes/views tracking

- Added authentication controllers (Login, Register)
- Added UserController for user profile management
- Added VideoController with full CRUD operations
- Added Video model with relationships (user, likes, views)
- Added User model enhancements (avatar, video relationships)
- Added database migrations for video_likes, video_views, user_avatar, video_visibility
- Added CompressVideoJob for video processing
- Added VideoUploaded mail notification
- Added authentication routes
- Updated web routes with video and user routes
- Added layout templates (app, plain, partials)
- Added user views (profile, settings, channel, history, liked)
- Added video views (create, edit, index, show)
- Added email templates
This commit is contained in:
ghassan committed 2026-02-25 00:03:02 +00:00
1 parent 6a2026df4b
commit 5253f89b63
35 files changed
+5092 -849

No files matched your search

@@ -0,0 +1,26 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::create('video_likes', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->onDelete('cascade');
$table->foreignId('video_id')->constrained()->onDelete('cascade');
$table->timestamps();
$table->unique(['user_id', 'video_id']);
});
}
public function down()
{
Schema::dropIfExists('video_likes');
}
};
@@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::create('video_views', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->onDelete('cascade');
$table->foreignId('video_id')->constrained()->onDelete('cascade');
$table->timestamp('watched_at')->useCurrent();
$table->index(['user_id', 'watched_at']);
$table->index(['video_id', 'watched_at']);
});
}
public function down()
{
Schema::dropIfExists('video_views');
}
};
@@ -0,0 +1,23 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('avatar')->nullable()->after('email');
});
}
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('avatar');
});
}
};
@@ -10,6 +10,7 @@ return new class extends Migration
{
Schema::create('videos', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->onDelete('cascade');
$table->string('title');
$table->text('description')->nullable();
$table->string('filename');
@@ -17,6 +18,10 @@ return new class extends Migration
$table->string('thumbnail')->nullable();
$table->integer('duration')->default(0);
$table->bigInteger('size')->default(0);
$table->string('mime_type')->nullable();
$table->enum('orientation', ['landscape', 'portrait', 'square', 'ultrawide'])->default('landscape');
$table->integer('width')->nullable();
$table->integer('height')->nullable();
$table->enum('status', ['pending', 'processing', 'ready', 'failed'])->default('pending');
$table->timestamps();
});
@@ -0,0 +1,23 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::table('videos', function (Blueprint $table) {
$table->enum('visibility', ['public', 'unlisted', 'private'])->default('public')->after('status');
});
}
public function down()
{
Schema::table('videos', function (Blueprint $table) {
$table->dropColumn('visibility');
});
}
};
@@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('jobs', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('jobs');
}
};