This commit is contained in:
2025-02-16 21:11:07 +02:00
parent 87bbfc33d3
commit e8d7e6a1c4
253 changed files with 3879 additions and 72 deletions
+47 -1
View File
@@ -3,9 +3,55 @@
namespace App\Http\Controllers\Forum; namespace App\Http\Controllers\Forum;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Http\Requests\Forum\PostRequest;
use App\Models\Forum\Post;
use App\Models\Forum\Thread;
use App\Models\Forum\Topic;
use Illuminate\Http\Request; use Illuminate\Http\Request;
class PostsController extends Controller class PostsController extends Controller
{ {
// public function create()
{
// full reply?
}
public function store(PostRequest $request, string $categorySlug, string $threadSlug, string $topicSlug)
{
$thread = Thread::with('category')->where('slug', $threadSlug)->first();
$topic = Topic::where('slug', $topicSlug)->first();
if ($topic->status == Topic::STATUS_CLOSED) {
abort(403);
}
Post::create([
'content' => $request->get('content'),
'user_id' => auth()->user()->id,
'category_id' => $thread->category->id,
'thread_id' => $thread->id,
'topic_id' => $topic->id,
]);
$topic->replies_no = $topic->replies_no+1;
$topic->save();
// redirect back, keep in mind pagination
return redirect()->back()->with('success', 'Reply posted!');
}
public function edit(int $id)
{
}
public function update(PostRequest $request, int $id)
{
}
public function destroy(int $id)
{
}
} }
@@ -4,12 +4,76 @@ namespace App\Http\Controllers\Forum;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Http\Requests\Forum\TopicRequest; use App\Http\Requests\Forum\TopicRequest;
use App\Models\Forum\Category;
use App\Models\Forum\Post;
use App\Models\Forum\Thread;
use App\Models\Forum\Topic;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Str;
class TopicsController extends Controller class TopicsController extends Controller
{ {
public function create(TopicRequest $request) public function show(string $categorySlug, string $threadSlug, string $topicSlug)
{ {
return view('forum.topics.create'); $thread = Thread::with('category')->where('slug', $threadSlug)->first();
$topic = Topic::where('slug', $topicSlug)->first();
$topic->views_no = $topic->views_no+1;
$topic->save();
$posts = Post::with('author')->where('topic_id', $topic->id)->paginate(15);
return view('forum.topics.show', compact('thread', 'topic', 'posts'));
}
public function create(string $categorySlug, string $threadSlug)
{
// check policy
$forumCategories = Category::get();
$forumThreads = Thread::get();
$currentThread = Thread::with('category')->where('slug', $threadSlug)->first();
return view('forum.topics.create', compact('forumCategories', 'forumThreads', 'currentThread'));
}
public function store(TopicRequest $request, string $categorySlug, string $threadSlug)
{
// check policy
$thread = Thread::with('category')->where('slug', $threadSlug)->first();
$topic = Topic::create([
'name' => $request->get('name'),
'slug' => Str::slug($request->get('name')),
'status' => Topic::STATUS_OPEN,
'category_id' => $thread->category->id,
'thread_id' => $thread->id,
'user_id' => auth()->user()->id,
]);
Post::create([
'content' => $request->get('content'),
'user_id' => auth()->user()->id,
'category_id' => $thread->category->id,
'thread_id' => $thread->id,
'topic_id' => $topic->id,
]);
return redirect()->route('forums.thread.topics.show', [$categorySlug, $threadSlug, $topic->slug]);
}
public function edit(string $categorySlug, string $threadSlug, string $topicSlug)
{
// check policy
}
public function update(TopicRequest $request)
{
// check policy
}
public function destroy()
{
// check policy
} }
} }
+16 -1
View File
@@ -2,6 +2,7 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Http\Requests\Movie\CommentRequest;
use App\Models\Comment; use App\Models\Comment;
use App\Models\Movie; use App\Models\Movie;
use Illuminate\Http\Request; use Illuminate\Http\Request;
@@ -31,7 +32,21 @@ class MovieController extends Controller
}) })
->paginate(15); ->paginate(15);
return view('movie.show', compact('movie', 'comments')); return view('movie.show', compact('movie', 'comments'));
} }
public function storeComment(CommentRequest $request, string $movieSlug)
{
$movie = Movie::where('slug', $movieSlug)->firstOrFail();
Comment::create([
'entity_id' => $movie->id,
'entity_type' => Comment::TYPE_MOVIE,
'user_id' => auth()->user()->id,
'content' => $request->get('content'),
'published_at' => new \DateTime(),
]);
return redirect()->back()->with('success', 'Comment posted!');
}
} }
+11 -1
View File
@@ -2,6 +2,8 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Models\MediaList;
use App\Models\MediaListItem;
use App\Models\User; use App\Models\User;
use Illuminate\Http\Request; use Illuminate\Http\Request;
@@ -11,6 +13,14 @@ class ProfileController extends Controller
{ {
$user = User::where('slug', $slug)->first(); $user = User::where('slug', $slug)->first();
return view('profile.show', compact('user')); $watchedList = MediaList::where('slug', MediaList::WATCHED)->first();
$lastWatchedListItem = MediaListItem::with('item')->where('media_list_id', $watchedList->id)
->orderBy('id', 'desc')
->first();
$lastWatched = $lastWatchedListItem->item;
return view('profile.show', compact('user', 'lastWatched'));
} }
} }
+4 -1
View File
@@ -2,6 +2,7 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Models\Season;
use App\Models\Show; use App\Models\Show;
use Illuminate\Http\Request; use Illuminate\Http\Request;
@@ -20,6 +21,8 @@ class ShowController extends Controller
$comments = []; $comments = [];
return view('show.show', compact('show', 'comments')); $seasons = Season::where('show_id', $show->id)->orderBy('season_number', 'ASC')->get();
return view('show.show', compact('show', 'comments', 'seasons'));
} }
} }
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace App\Http\Requests\Forum;
use Illuminate\Foundation\Http\FormRequest;
class PostRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'content' => 'required|min:2'
];
}
}
+3 -2
View File
@@ -11,7 +11,7 @@ class TopicRequest extends FormRequest
*/ */
public function authorize(): bool public function authorize(): bool
{ {
return false; return true;
} }
/** /**
@@ -22,7 +22,8 @@ class TopicRequest extends FormRequest
public function rules(): array public function rules(): array
{ {
return [ return [
// 'name' => 'required|min:2|max:255',
'content' => 'required|min:2',
]; ];
} }
} }
@@ -0,0 +1,28 @@
<?php
namespace App\Http\Requests\Movie;
use Illuminate\Foundation\Http\FormRequest;
class CommentRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'content' => 'required|min:2'
];
}
}
@@ -18,8 +18,6 @@ class Recommendations extends Component
public function mount() public function mount()
{ {
$movie = Movie::find($this->movie->id);
$this->recommendations = Movie::whereIn('id', MovieRecommendation::where('movie_id', $this->movie->id)->pluck('recommended_movie_id'))->get(); $this->recommendations = Movie::whereIn('id', MovieRecommendation::where('movie_id', $this->movie->id)->pluck('recommended_movie_id'))->get();
} }
} }
+13
View File
@@ -2,12 +2,25 @@
namespace App\Livewire\MoviePage; namespace App\Livewire\MoviePage;
use App\Models\Movie;
use App\Models\MovieSimilar;
use Livewire\Component; use Livewire\Component;
class Similar extends Component class Similar extends Component
{ {
public $movie;
public $similarMovies;
public function render() public function render()
{ {
return view('livewire.movie-page.similar'); return view('livewire.movie-page.similar');
} }
public function mount()
{
$this->similarMovies = Movie::whereIn(
'id',
MovieSimilar::where('movie_id', $this->movie->id)->pluck('similar_movie_id')
)->get();
}
} }
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace App\Livewire\MoviePage\Tabs;
use App\Models\Movie;
use Livewire\Component;
class Videos extends Component
{
public $movie;
public $videos;
public function render()
{
return view('livewire.movie-page.tabs.videos');
}
public function mount()
{
$this->movie = Movie::with('videos')->where('id', $this->movie->id)->first();
$this->videos = $this->movie->videos;
}
}
+5
View File
@@ -21,4 +21,9 @@ class Comment extends Model
'tmdb_id', 'tmdb_id',
'tmdb_url', 'tmdb_url',
]; ];
public function author()
{
return $this->hasOne(User::class, 'id', 'user_id');
}
} }
+15 -1
View File
@@ -2,9 +2,23 @@
namespace App\Models\Forum; namespace App\Models\Forum;
use App\Models\User;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
class Post extends Model class Post extends Model
{ {
// protected $table = 'forum_posts';
protected $fillable = [
'content',
'user_id',
'category_id',
'thread_id',
'topic_id',
];
public function author()
{
return $this->hasOne(User::class, 'id', 'user_id');
}
} }
+5
View File
@@ -7,4 +7,9 @@ use Illuminate\Database\Eloquent\Model;
class Thread extends Model class Thread extends Model
{ {
protected $table = 'forum_threads'; protected $table = 'forum_threads';
public function category()
{
return $this->hasOne(Category::class, 'id', 'category_id');
}
} }
+5
View File
@@ -8,6 +8,9 @@ class Topic extends Model
{ {
protected $table = 'forum_topics'; protected $table = 'forum_topics';
public const STATUS_OPEN = 'open';
public const STATUS_CLOSED = 'closed';
protected $fillable = [ protected $fillable = [
'name', 'name',
'slug', 'slug',
@@ -15,5 +18,7 @@ class Topic extends Model
'category_id', 'category_id',
'thread_id', 'thread_id',
'user_id', 'user_id',
'views_no',
'replies_no',
]; ];
} }
+11
View File
@@ -58,6 +58,17 @@ class Movie extends Model
return $rating ? $rating->rate : null; return $rating ? $rating->rate : null;
} }
public function trailer()
{
return $this->belongsToMany(Video::class, 'movie_videos', 'movie_id', 'video_id')
->where('videos.type', 'Trailer');
}
public function externalIds()
{
return $this->hasOne(ExternalId::class, 'entity_id', 'id')->where('entity_type', ExternalId::TYPE_MOVIE);
}
public function director() public function director()
{ {
return $this->belongsToMany(Person::class, 'movie_cast', 'movie_id', 'person_id') return $this->belongsToMany(Person::class, 'movie_cast', 'movie_id', 'person_id')
+16
View File
@@ -0,0 +1,16 @@
<?php
namespace App\Policies\Forum;
use App\Models\User;
class CreatePostPolicy
{
/**
* Create a new policy instance.
*/
public function __construct()
{
//
}
}
+16
View File
@@ -0,0 +1,16 @@
<?php
namespace App\Policies\Forum;
use App\Models\User;
class CreateTopicPolicy
{
/**
* Create a new policy instance.
*/
public function __construct()
{
//
}
}
+16
View File
@@ -0,0 +1,16 @@
<?php
namespace App\Policies\Forum;
use App\Models\User;
class DeletePostPolicy
{
/**
* Create a new policy instance.
*/
public function __construct()
{
//
}
}
+16
View File
@@ -0,0 +1,16 @@
<?php
namespace App\Policies\Forum;
use App\Models\User;
class DeleteTopicPolicy
{
/**
* Create a new policy instance.
*/
public function __construct()
{
//
}
}
+16
View File
@@ -0,0 +1,16 @@
<?php
namespace App\Policies\Forum;
use App\Models\User;
class EditPostPolicy
{
/**
* Create a new policy instance.
*/
public function __construct()
{
//
}
}
+16
View File
@@ -0,0 +1,16 @@
<?php
namespace App\Policies\Forum;
use App\Models\User;
class EditTopicPolicy
{
/**
* Create a new policy instance.
*/
public function __construct()
{
//
}
}
+3 -1
View File
@@ -11,10 +11,12 @@
"require": { "require": {
"php": "^8.2", "php": "^8.2",
"ext-zlib": "*", "ext-zlib": "*",
"blade-ui-kit/blade-ui-kit": "^0.6.4",
"laravel/framework": "^11.31", "laravel/framework": "^11.31",
"laravel/tinker": "^2.9", "laravel/tinker": "^2.9",
"laravel/ui": "^4.6", "laravel/ui": "^4.6",
"livewire/livewire": "^3.5" "livewire/livewire": "^3.5",
"multicaret/laravel-acquaintances": "^3.6"
}, },
"require-dev": { "require-dev": {
"fakerphp/faker": "^1.23", "fakerphp/faker": "^1.23",
Generated
+149 -1
View File
@@ -4,8 +4,86 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "4e7e2781a95eda3eb8e36b6b04f4625f", "content-hash": "6d84b8d65adb605b5a8df2d31dee572e",
"packages": [ "packages": [
{
"name": "blade-ui-kit/blade-ui-kit",
"version": "0.6.4",
"source": {
"type": "git",
"url": "https://github.com/blade-ui-kit/blade-ui-kit.git",
"reference": "ea7efd8b2ad613fa4441a51f1312d71153c27b22"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/blade-ui-kit/blade-ui-kit/zipball/ea7efd8b2ad613fa4441a51f1312d71153c27b22",
"reference": "ea7efd8b2ad613fa4441a51f1312d71153c27b22",
"shasum": ""
},
"require": {
"ext-json": "*",
"illuminate/filesystem": "^10.0|^11.0",
"illuminate/support": "^10.0|^11.0",
"illuminate/view": "^10.0|^11.0",
"nesbot/carbon": "^2.38|^3.0",
"php": "^8.1"
},
"require-dev": {
"guzzlehttp/guzzle": "^7.4",
"league/commonmark": "^1.4|^2.0",
"livewire/livewire": "^3.0",
"lorisleiva/cron-translator": "^0.1.1|^0.4",
"orchestra/testbench": "^8.0|^9.0",
"orchestra/testbench-dusk": "^8.0|^9.0",
"pestphp/pest": "^2.34|^3.0",
"phpunit/phpunit": "^10.5|^11.0"
},
"suggest": {
"league/commonmark": "Required to use the markdown component (^1.4).",
"lorisleiva/cron-translator": "Required to use the cron component (^0.1.1)."
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"BladeUIKit\\BladeUIKitServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"BladeUIKit\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Dries Vints",
"homepage": "https://driesvints.com"
}
],
"description": "A set of renderless components to utilise in your Laravel Blade views.",
"homepage": "https://github.com/blade-ui-kit/blade-ui-kit",
"keywords": [
"blade",
"laravel",
"ui"
],
"support": {
"issues": "https://github.com/blade-ui-kit/blade-ui-kit/issues",
"source": "https://github.com/blade-ui-kit/blade-ui-kit"
},
"funding": [
{
"url": "https://github.com/sponsors/driesvints",
"type": "github"
}
],
"time": "2024-12-02T13:32:27+00:00"
},
{ {
"name": "brick/math", "name": "brick/math",
"version": "0.12.1", "version": "0.12.1",
@@ -2248,6 +2326,76 @@
], ],
"time": "2024-12-05T17:15:07+00:00" "time": "2024-12-05T17:15:07+00:00"
}, },
{
"name": "multicaret/laravel-acquaintances",
"version": "v3.6.1",
"source": {
"type": "git",
"url": "https://github.com/multicaret/laravel-acquaintances.git",
"reference": "ae1c4aebe2137cc5c89072e2124e99e8843cdf64"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/multicaret/laravel-acquaintances/zipball/ae1c4aebe2137cc5c89072e2124e99e8843cdf64",
"reference": "ae1c4aebe2137cc5c89072e2124e99e8843cdf64",
"shasum": ""
},
"require": {
"php": ">=8.0"
},
"require-dev": {
"codeclimate/php-test-reporter": "^0.3.2",
"doctrine/dbal": "^2.5",
"fzaninotto/faker": "~1.4",
"laravel/laravel": "5.*|^9.0|^10.0|^11.0",
"mockery/mockery": "1.0.x-dev",
"phpunit/phpunit": "5.*"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Multicaret\\Acquaintances\\AcquaintancesServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Multicaret\\Acquaintances\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mohamed Kawsara",
"email": "mkwsra@gmail.com"
}
],
"description": "This light package, with no dependencies, gives Eloquent models the ability to manage friendships (with groups). And interactions such as: Likes, favorites, votes, subscribe, follow, ..etc. And it includes advanced rating system.",
"keywords": [
"Followers",
"Rate",
"Rating",
"eloquent",
"followships",
"friend-system",
"friends",
"friendships",
"interactions",
"laravel",
"like",
"social-media",
"wish-list"
],
"support": {
"issues": "https://github.com/multicaret/laravel-acquaintances/issues",
"source": "https://github.com/multicaret/laravel-acquaintances/tree/v3.6.1"
},
"time": "2024-06-08T13:48:12+00:00"
},
{ {
"name": "nesbot/carbon", "name": "nesbot/carbon",
"version": "3.8.4", "version": "3.8.4",
+87
View File
@@ -0,0 +1,87 @@
<?php
return [
/**
* Load migrations from package migrations,
* If you published the migration files, please set to `false`.
*/
'migrations' => false,
/*
* Models Related.
*/
'model_namespace' => (int) app()->version() <= 7 ? 'App' : 'App\Models',
'models' => [
/*
* Model name of User model
*/
'user' => 'User',
/*
* Model name of Interaction Relation model
*/
'interaction_relation' => \Multicaret\Acquaintances\Models\InteractionRelation::class,
/*
* Model name of Interaction Relation model
*/
'friendship' => \Multicaret\Acquaintances\Models\Friendship::class,
/*
* Model name of Interaction Relation model
*/
'friendship_groups' => \Multicaret\Acquaintances\Models\FriendFriendshipGroups::class,
],
'tables' => [
/*
* Table name of interactions relations.
*/
'interactions' => 'interactions',
/*
* user foreign key column name within interactions table.
*/
'interactions_user_id_fk_column_name' => 'user_id',
/*
* user foreign key column type within interactions table.
*/
'interactions_user_id_fk_column_type' => 'unsignedBigInteger',
/*
* Table name of friendships relations.
*/
'friendships' => 'friendships',
/*
* Table name of friendship Groups relations.
*/
'friendship_groups' => 'friendship_groups',
],
'rating' => [
'defaults' => [
'amount' => 5,
/*
* Default type here is 'general', as longs as you have one criteria of rating a model
* you can ignore this setting.
* It will be the default type of rating of null is provided, if you wish to tweak this type name
* use the value below as you wish.
*
*/
'type' => 'general',
],
'types' => [
/* Add any other type that your website/application have here,
* the following added rating types are for demonstration purposes only.
* There is no effect on deleting them nor adding to them, however, its a good practice
* to not hard code your rating types, hence, please use this simple array
*/
'delivery-time',
'quality',
'communication',
'commitment',
]
],
'friendships_groups' => [
'acquaintances' => 0,
'close_friends' => 1,
'family' => 2
],
];
+131
View File
@@ -0,0 +1,131 @@
<?php
use BladeUIKit\Components;
return [
/*
|--------------------------------------------------------------------------
| Components
|--------------------------------------------------------------------------
|
| Below you reference all components that should be loaded for your app.
| By default all components from Blade UI Kit are loaded in. You can
| disable or overwrite any component class or alias that you want.
|
*/
'components' => [
'alert' => Components\Alerts\Alert::class,
'avatar' => Components\Support\Avatar::class,
'carbon' => Components\DateTime\Carbon::class,
'checkbox' => Components\Forms\Inputs\Checkbox::class,
'color-picker' => Components\Forms\Inputs\ColorPicker::class,
'countdown' => Components\DateTime\Countdown::class,
'cron' => Components\Support\Cron::class,
'dropdown' => Components\Navigation\Dropdown::class,
'easy-mde' => Components\Editors\EasyMDE::class,
'email' => Components\Forms\Inputs\Email::class,
'error' => Components\Forms\Error::class,
'flat-pickr' => Components\Forms\Inputs\FlatPickr::class,
'form' => Components\Forms\Form::class,
'form-button' => Components\Buttons\FormButton::class,
'html' => Components\Layouts\Html::class,
'input' => Components\Forms\Inputs\Input::class,
'label' => Components\Forms\Label::class,
'logout' => Components\Buttons\Logout::class,
'mapbox' => Components\Maps\Mapbox::class,
'markdown' => Components\Markdown\Markdown::class,
'password' => Components\Forms\Inputs\Password::class,
'pikaday' => Components\Forms\Inputs\Pikaday::class,
'social-meta' => Components\Layouts\SocialMeta::class,
'textarea' => Components\Forms\Inputs\Textarea::class,
'toc' => Components\Markdown\ToC::class,
'trix' => Components\Editors\Trix::class,
'unsplash' => Components\Support\Unsplash::class,
],
/*
|--------------------------------------------------------------------------
| Livewire Components
|--------------------------------------------------------------------------
|
| Below you reference all the Livewire components that should be loaded
| for your app. By default all components from Blade UI Kit are loaded in.
|
*/
'livewire' => [
//
],
/*
|--------------------------------------------------------------------------
| Components Prefix
|--------------------------------------------------------------------------
|
| This value will set a prefix for all Blade UI Kit components.
| By default it's empty. This is useful if you want to avoid
| collision with components from other libraries.
|
| If set with "buk", for example, you can reference components like:
|
| <x-buk-easy-mde />
|
*/
'prefix' => '',
/*
|--------------------------------------------------------------------------
| Third Party Asset Libraries
|--------------------------------------------------------------------------
|
| These settings hold reference to all third party libraries and their
| asset files served through a CDN. Individual components can require
| these asset files through their static `$assets` property.
|
*/
'assets' => [
'alpine' => 'https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js',
'easy-mde' => [
'https://unpkg.com/easymde/dist/easymde.min.css',
'https://unpkg.com/easymde/dist/easymde.min.js',
],
'flat-pickr' => [
'https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css',
'https://cdn.jsdelivr.net/npm/flatpickr@4.6.9/dist/flatpickr.min.js',
],
'mapbox' => [
'https://api.mapbox.com/mapbox-gl-js/v1.8.1/mapbox-gl.css',
'https://api.mapbox.com/mapbox-gl-js/v1.8.1/mapbox-gl.js',
],
'moment' => [
'https://cdn.jsdelivr.net/npm/moment@2.26.0/moment.min.js',
'https://cdn.jsdelivr.net/npm/moment-timezone@0.5.31/builds/moment-timezone-with-data.min.js',
],
'pickr' => [
'https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/themes/classic.min.css',
'https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/pickr.min.js',
],
'pikaday' => [
'https://cdn.jsdelivr.net/npm/pikaday/css/pikaday.css',
'https://cdn.jsdelivr.net/npm/pikaday/pikaday.js',
],
'trix' => [
'https://unpkg.com/trix@1.2.3/dist/trix.css',
'https://unpkg.com/trix@1.2.3/dist/trix.js',
],
],
];
@@ -15,14 +15,14 @@ return new class extends Migration
$table->id(); $table->id();
$table->integer('entity_id'); $table->integer('entity_id');
$table->string('entity_type'); $table->string('entity_type');
$table->integer('user_id')->nullable(true); $table->integer('user_id')->nullable();
$table->string('author_name'); $table->string('author_name')->nullable();
$table->string('author_avatar')->nullable(); $table->string('author_avatar')->nullable();
$table->integer('author_rating')->nullable(); $table->integer('author_rating')->nullable();
$table->text('content'); $table->text('content');
$table->datetime('published_at'); $table->datetime('published_at');
$table->string('tmdb_id'); $table->string('tmdb_id')->nullable();
$table->string('tmdb_url'); $table->string('tmdb_url')->nullable();
$table->timestamps(); $table->timestamps();
}); });
} }
@@ -19,6 +19,10 @@ return new class extends Migration
$table->unsignedBigInteger('category_id'); $table->unsignedBigInteger('category_id');
$table->unsignedBigInteger('thread_id'); $table->unsignedBigInteger('thread_id');
$table->unsignedBigInteger('user_id'); $table->unsignedBigInteger('user_id');
$table->unsignedInteger('views_no');
$table->unsignedInteger('replies_no');
$table->timestamps(); $table->timestamps();
}); });
} }
@@ -13,6 +13,9 @@ return new class extends Migration
{ {
Schema::create('forum_posts', function (Blueprint $table) { Schema::create('forum_posts', function (Blueprint $table) {
$table->id(); $table->id();
$table->unsignedBigInteger('topic_id');
$table->unsignedBigInteger('thread_id');
$table->unsignedBigInteger('category_id');
$table->text('content'); $table->text('content');
$table->unsignedBigInteger('user_id'); $table->unsignedBigInteger('user_id');
$table->timestamps(); $table->timestamps();
@@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateAcquaintancesFriendshipTable extends Migration
{
public function up()
{
Schema::create(config('acquaintances.tables.friendships'), function (Blueprint $table) {
$table->id();
$table->morphs('sender');
$table->morphs('recipient');
$table->string('status')->default('pending')->comment('pending/accepted/denied/blocked/');
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists(config('acquaintances.tables.friendships'));
}
}
@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
/**
* Class CreateFriendshipsGroupsTable
*/
class CreateAcquaintancesFriendshipsGroupsTable extends Migration
{
public function up()
{
Schema::create(config('acquaintances.tables.friendship_groups'), function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('friendship_id')->unsigned();
$table->morphs('friend');
$table->integer('group_id')->unsigned();
$table->foreign('friendship_id')
->references('id')
->on(config('acquaintances.tables.friendships'))
->onDelete('cascade');
$table->unique(['friendship_id', 'friend_id', 'friend_type', 'group_id'], 'unique');
});
}
public function down()
{
Schema::dropIfExists(config('acquaintances.tables.friendship_groups'));
}
}
@@ -0,0 +1,50 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Multicaret\Acquaintances\Interaction;
class CreateAcquaintancesInteractionsTable extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::create(config('acquaintances.tables.interactions', 'interactions'), function (Blueprint $table) {
$table->id();
$userModel = Interaction::getUserModelName();
$userModel = (new $userModel);
$userIdFkColumnName = config('acquaintances.tables.interactions_user_id_fk_column_name', 'user_id');
$userIdFkType = config('acquaintances.tables.interactions_user_id_fk_column_type');
$table->{$userIdFkType}($userIdFkColumnName)->index();
$table->morphs('subject');
$table->string('relation')->default('follow')->comment('follow/like/subscribe/favorite/upvote/downvote');
$table->double('relation_value')->nullable();
$table->string('relation_type')->nullable();
$table->timestamps();
$table->foreign($userIdFkColumnName)
->references($userModel->getKeyName())
->on($userModel->getTable())
->onUpdate('cascade')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*/
public function down()
{
Schema::table(config('acquaintances.tables.interactions', 'interactions'), function ($table) {
$table->dropForeign(config('acquaintances.tables.interactions', 'interactions').'_user_id_foreign');
});
Schema::drop(config('acquaintances.tables.interactions', 'interactions'));
}
}
+10
View File
@@ -6,6 +6,7 @@
"": { "": {
"dependencies": { "dependencies": {
"bs5-lightbox": "^1.8.3", "bs5-lightbox": "^1.8.3",
"font-awesome": "^4.7.0",
"jquery": "^3.7.1", "jquery": "^3.7.1",
"owl-carousel": "^1.0.0" "owl-carousel": "^1.0.0"
}, },
@@ -1830,6 +1831,15 @@
} }
} }
}, },
"node_modules/font-awesome": {
"version": "4.7.0",
"resolved": "https://registry.npmjs.org/font-awesome/-/font-awesome-4.7.0.tgz",
"integrity": "sha512-U6kGnykA/6bFmg1M/oT9EkFeIYv7JlX3bozwQJWiiLz6L0w3F5vBVPxHlwyX/vtNq1ckcpRKOB9f2Qal/VtFpg==",
"license": "(OFL-1.1 AND MIT)",
"engines": {
"node": ">=0.10.3"
}
},
"node_modules/foreground-child": { "node_modules/foreground-child": {
"version": "3.3.0", "version": "3.3.0",
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz",
+1
View File
@@ -19,6 +19,7 @@
}, },
"dependencies": { "dependencies": {
"bs5-lightbox": "^1.8.3", "bs5-lightbox": "^1.8.3",
"font-awesome": "^4.7.0",
"jquery": "^3.7.1", "jquery": "^3.7.1",
"owl-carousel": "^1.0.0" "owl-carousel": "^1.0.0"
} }
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

Some files were not shown because too many files have changed in this diff Show More