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

+49 -148
View File
@@ -1,105 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ $video->title }} | TAKEONE</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
@extends('layouts.app')
@section('title', $video->title . ' | TAKEONE')
@section('extra_styles')
<style>
:root {
--brand-red: #e61e1e;
--bg-dark: #0f0f0f;
--bg-secondary: #1e1e1e;
--border-color: #303030;
--text-primary: #f1f1f1;
--text-secondary: #aaaaaa;
}
* { box-sizing: border-box; }
body {
background-color: var(--bg-dark);
color: var(--text-primary);
font-family: "Roboto", "Arial", sans-serif;
margin: 0;
padding: 0;
}
/* Header */
.yt-header {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 56px;
background: var(--bg-dark);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 16px;
z-index: 1000;
border-bottom: 1px solid var(--border-color);
}
.yt-header-left { display: flex; align-items: center; gap: 16px; }
.yt-menu-btn {
width: 40px; height: 40px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
cursor: pointer; background: transparent; border: none; color: var(--text-primary);
}
.yt-menu-btn:hover { background: var(--border-color); }
.yt-logo-text { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); letter-spacing: -1px; }
.yt-header-center { flex: 1; max-width: 640px; margin: 0 40px; display: flex; }
.yt-search { flex: 1; display: flex; height: 40px; }
.yt-search-input {
flex: 1; background: #121212; border: 1px solid var(--border-color);
border-right: none; border-radius: 20px 0 0 20px; padding: 0 16px;
color: var(--text-primary); font-size: 16px;
}
.yt-search-input:focus { outline: none; border-color: #1c62b9; }
.yt-search-btn {
width: 64px; background: #222; border: 1px solid var(--border-color);
border-radius: 0 20px 20px 0; color: var(--text-primary); cursor: pointer;
}
.yt-search-btn:hover { background: #303030; }
.yt-header-right { display: flex; align-items: center; gap: 8px; }
.yt-icon-btn {
width: 40px; height: 40px; border-radius: 50%; display: flex;
align-items: center; justify-content: center; cursor: pointer;
background: transparent; border: none; color: var(--text-primary); font-size: 1.2rem;
}
.yt-icon-btn:hover { background: var(--border-color); }
.yt-user-avatar { width: 32px; height: 32px; border-radius: 50%; background: #555; cursor: pointer; }
.yt-upload-btn {
background: var(--brand-red); color: white; border: none;
padding: 8px 16px; border-radius: 20px; font-weight: 500;
display: flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none;
}
/* Main Layout */
.yt-main {
margin-top: 56px;
margin-left: 240px;
padding: 24px;
display: flex;
gap: 24px;
}
/* Video Section */
.yt-video-section { flex: 1; min-width: 0; }
@@ -111,13 +15,16 @@
border-radius: 12px;
overflow: hidden;
max-height: 70vh;
display: flex;
justify-content: center;
align-items: center;
}
.video-container.portrait { aspect-ratio: 9/16; aspect-ratio: 9/16; }
.video-container.square { aspect-ratio: 1/1; aspect-ratio: 1/1; }
.video-container.portrait { aspect-ratio: 9/16; }
.video-container.square { aspect-ratio: 1/1; }
.video-container.ultrawide { aspect-ratio: 21/9; }
.video-container video { width: 100%; height: 100%; object-fit: contain; }
.video-container video { width: 100%; height: 100%; object-fit: contain; }
/* Video Info */
.video-title {
@@ -216,7 +123,7 @@
}
/* Sidebar */
.yt-sidebar {
.yt-sidebar-container {
width: 400px;
flex-shrink: 0;
}
@@ -255,12 +162,12 @@
/* Responsive */
@media (max-width: 1300px) {
.yt-sidebar { width: 300px; }
.yt-sidebar-container { width: 300px; }
}
@media (max-width: 991px) {
.yt-main { margin-left: 0; flex-direction: column; }
.yt-sidebar { width: 100%; }
.yt-sidebar-container { width: 100%; }
.yt-header-center { display: none; }
.sidebar-video-card { flex-direction: column; }
.sidebar-thumb { width: 100%; }
@@ -272,35 +179,11 @@
.yt-main { padding: 16px; }
}
</style>
</head>
<body>
<!-- Header -->
<header class="yt-header">
<div class="yt-header-left">
<a href="/videos" class="yt-menu-btn">
<i class="bi bi-arrow-left"></i>
</a>
<a href="/videos" class="yt-logo-text">TAKEONE</a>
</div>
<div class="yt-header-center d-none d-md-flex">
<div class="yt-search">
<input type="text" class="yt-search-input" placeholder="Search">
<button class="yt-search-btn"><i class="bi bi-search"></i></button>
</div>
</div>
<div class="yt-header-right">
<a href="/videos/create" class="yt-upload-btn d-none d-sm-flex">
<i class="bi bi-plus-lg"></i>
<span>Upload</span>
</a>
<img src="https://i.pravatar.cc/150?u=user" class="yt-user-avatar" alt="User">
</div>
</header>
<!-- Main Content -->
<main class="yt-main">
@endsection
@section('content')
<!-- Video Layout Container -->
<div style="display: flex; gap: 24px; max-width: 1800px; margin: 0 auto;">
<!-- Video Section -->
<div class="yt-video-section">
<!-- Video Player -->
@@ -325,22 +208,38 @@
@endif
</div>
<div class="video-actions">
<button class="yt-action-btn"><i class="bi bi-hand-thumbs-up"></i> Like</button>
<button class="yt-action-btn"><i class="bi bi-share"></i> Share</button>
<button class="yt-action-btn"><i class="bi bi-bookmark"></i> Save</button>
@auth
<form method="POST" action="{{ $video->isLikedBy(Auth::user()) ? route('videos.unlike', $video->id) : route('videos.like', $video->id) }}" class="d-inline">
@csrf
<button type="submit" class="yt-action-btn {{ $video->isLikedBy(Auth::user()) ? 'liked' : '' }}">
<i class="bi {{ $video->isLikedBy(Auth::user()) ? 'bi-hand-thumbs-up-fill' : 'bi-hand-thumbs-up' }}"></i>
{{ $video->like_count > 0 ? $video->like_count : 'Like' }}
</button>
</form>
@else
<a href="{{ route('login') }}" class="yt-action-btn">
<i class="bi bi-hand-thumbs-up"></i> Like
</a>
@endauth
@if($video->isShareable())
<button class="yt-action-btn" onclick="openShareModal('{{ $video->share_url }}', '{{ addslashes($video->title) }}')"><i class="bi bi-share"></i> Share</button>
@endif
</div>
</div>
<!-- Channel Row -->
<div class="channel-row">
<div class="channel-info">
<div class="channel-avatar"></div>
<a href="{{ route('channel', $video->user_id) }}" class="channel-info text-decoration-none" style="color: inherit;">
@if($video->user)
<img src="{{ $video->user->avatar_url }}" class="channel-avatar" alt="{{ $video->user->name }}">
@else
<div class="channel-avatar"></div>
@endif
<div>
<div class="channel-name">TAKEONE</div>
<div class="channel-name">{{ $video->user->name ?? 'Unknown' }}</div>
<div class="channel-subs">Video Creator</div>
</div>
</div>
<button class="subscribe-btn">Subscribe</button>
</a>
</div>
<!-- Description -->
@@ -352,11 +251,13 @@
</div>
<!-- Sidebar -->
<div class="yt-sidebar">
<div class="yt-sidebar-container">
<h3 style="font-size: 16px; font-weight: 500; margin-bottom: 12px;">Up Next</h3>
<!-- Placeholder for recommended videos - would be dynamic in full implementation -->
<div class="text-secondary">More videos coming soon...</div>
</div>
</main>
</body>
</html>
</div>
@include('layouts.partials.share-modal')
@endsection