├── database
├── .gitignore
├── seeders
│ ├── Content
│ │ ├── PointsSeeder.php
│ │ ├── LikesSeeder.php
│ │ ├── RepliesSeeder.php
│ │ ├── CommentsSeeder.php
│ │ ├── VisitsSeeder.php
│ │ ├── MembersSeeder.php
│ │ └── DiscussionsSeeder.php
│ ├── Referential
│ │ ├── ConfigurationSeeder.php
│ │ └── NotificationSeeder.php
│ ├── ContentSeeder.php
│ ├── DatabaseSeeder.php
│ ├── Permissions
│ │ ├── RolesSeeder.php
│ │ └── UserRolesSeeder.php
│ └── NotificationSeeder.php
├── factories
│ ├── DiscussionVisitFactory.php
│ ├── ReplyFactory.php
│ ├── DiscussionFactory.php
│ ├── UserFactory.php
│ ├── LikeFactory.php
│ └── CommentFactory.php
└── migrations
│ ├── 2022_12_24_151236_add_description_to_tags.php
│ ├── 2022_12_28_183737_add_is_public_to_discussions.php
│ ├── 2022_12_29_091049_add_total_points_to_user.php
│ ├── 2022_12_30_133311_add_meta_to_visits.php
│ ├── 2022_12_28_135432_add_best_answer_to_replies.php
│ ├── 2022_12_30_102655_add_locked_flag_to_discussions.php
│ ├── 2022_12_22_124442_create_notifications_table.php
│ ├── 2022_12_24_141352_add_resolved_flag_to_discussions.php
│ ├── 2022_12_23_103652_create_likes_table.php
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ ├── 2022_12_22_100059_create_user_roles_table.php
│ ├── 2022_12_28_182630_create_configurations_table.php
│ ├── 2022_12_22_145752_create_discussion_tags_table.php
│ ├── 2022_12_22_095913_create_permissions_table.php
│ ├── 2022_12_22_100105_create_role_permissions_table.php
│ ├── 2022_12_22_143642_create_tags_table.php
│ ├── 2022_12_23_082707_create_followers_table.php
│ ├── 2022_12_22_095906_create_roles_table.php
│ ├── 2022_12_30_122531_create_discussion_visits_table.php
│ ├── 2022_12_29_085520_create_points_table.php
│ ├── 2022_12_23_081648_create_comments_table.php
│ ├── 2022_12_22_145655_create_discussions_table.php
│ ├── 2022_12_30_122544_add_visits_to_discussions.php
│ ├── 2022_12_29_183445_create_notifications_table.php
│ ├── 2022_12_23_081436_create_replies_table.php
│ ├── 2014_10_12_000000_create_users_table.php
│ ├── 2019_08_19_000000_create_failed_jobs_table.php
│ ├── 2022_12_22_124447_create_user_notifications_table.php
│ ├── 2022_12_22_133607_create_socials_table.php
│ ├── 2022_12_28_142212_add_settings_to_users.php
│ ├── 2022_12_22_083621_create_jobs_table.php
│ └── 2019_12_14_000001_create_personal_access_tokens_table.php
├── bootstrap
├── cache
│ └── .gitignore
└── app.php
├── storage
├── logs
│ └── .gitignore
├── app
│ ├── public
│ │ └── .gitignore
│ └── .gitignore
└── framework
│ ├── testing
│ └── .gitignore
│ ├── views
│ └── .gitignore
│ ├── cache
│ ├── data
│ │ └── .gitignore
│ └── .gitignore
│ ├── sessions
│ └── .gitignore
│ └── .gitignore
├── public
├── robots.txt
├── img
│ └── socials
│ │ ├── google.svg
│ │ ├── facebook.svg
│ │ ├── twitter.svg
│ │ └── github.svg
├── .htaccess
└── vendor
│ └── amcharts
│ └── Animated.js
├── github-contents
├── 1.jpg
├── 2.jpg
├── 3.jpg
└── 4.png
├── postcss.config.js
├── tests
├── Unit
│ └── ExampleTest.php
├── Feature
│ ├── ExampleTest.php
│ └── AdminBackendUrlTest.php
├── TestCase.php
└── CreatesApplication.php
├── app
├── Http
│ ├── Controllers
│ │ ├── ForgotPasswordController.php
│ │ ├── Controller.php
│ │ ├── EmailVerificationController.php
│ │ └── LogoutController.php
│ ├── Livewire
│ │ ├── Tags.php
│ │ ├── Discussion
│ │ │ ├── ReplyBtn.php
│ │ │ ├── MarkAsResolved.php
│ │ │ └── Header.php
│ │ ├── Layout
│ │ │ ├── Notifications.php
│ │ │ └── Dialogs
│ │ │ │ └── Likes.php
│ │ ├── JustRegistered.php
│ │ └── Profile
│ │ │ ├── Likes.php
│ │ │ ├── Comments.php
│ │ │ ├── Socials.php
│ │ │ ├── Replies.php
│ │ │ ├── WorldMapVisits.php
│ │ │ ├── Discussions.php
│ │ │ └── Details.php
│ └── Middleware
│ │ ├── EncryptCookies.php
│ │ ├── VerifyCsrfToken.php
│ │ ├── PreventRequestsDuringMaintenance.php
│ │ ├── TrustHosts.php
│ │ ├── TrimStrings.php
│ │ ├── Authenticate.php
│ │ ├── ValidateSignature.php
│ │ ├── JustRegistered.php
│ │ ├── TrustProxies.php
│ │ ├── RedirectIfAuthenticated.php
│ │ └── DiscussionMiddleware.php
├── Core
│ ├── RoleConstants.php
│ ├── FollowerConstants.php
│ ├── ConfigurationConstants.php
│ ├── PermissionConstants.php
│ ├── NotificationConstants.php
│ ├── SocialConstants.php
│ └── PointsConstants.php
├── Filament
│ ├── Resources
│ │ ├── TagResource
│ │ │ └── Pages
│ │ │ │ ├── CreateTag.php
│ │ │ │ ├── ViewTag.php
│ │ │ │ ├── ListTags.php
│ │ │ │ └── EditTag.php
│ │ ├── RoleResource
│ │ │ └── Pages
│ │ │ │ ├── CreateRole.php
│ │ │ │ ├── ViewRole.php
│ │ │ │ ├── ListRoles.php
│ │ │ │ └── EditRole.php
│ │ ├── UserResource
│ │ │ └── Pages
│ │ │ │ ├── CreateUser.php
│ │ │ │ ├── ViewUser.php
│ │ │ │ ├── ListUsers.php
│ │ │ │ └── EditUser.php
│ │ ├── PermissionResource
│ │ │ └── Pages
│ │ │ │ ├── CreatePermission.php
│ │ │ │ ├── ViewPermission.php
│ │ │ │ ├── ListPermissions.php
│ │ │ │ └── EditPermission.php
│ │ ├── NotificationResource
│ │ │ └── Pages
│ │ │ │ ├── CreateNotification.php
│ │ │ │ ├── ViewNotification.php
│ │ │ │ ├── ListNotifications.php
│ │ │ │ └── EditNotification.php
│ │ └── ConfigurationResource
│ │ │ └── Pages
│ │ │ ├── CreateConfiguration.php
│ │ │ ├── ViewConfiguration.php
│ │ │ ├── ListConfigurations.php
│ │ │ └── EditConfiguration.php
│ └── Widgets
│ │ ├── LatestDiscussions.php
│ │ └── LatestReplies.php
├── Models
│ ├── Configuration.php
│ ├── Social.php
│ ├── Permission.php
│ ├── Tag.php
│ ├── UserRole.php
│ ├── Point.php
│ ├── Notification.php
│ ├── DiscussionTag.php
│ ├── Follower.php
│ ├── RolePermission.php
│ ├── Like.php
│ ├── UserNotification.php
│ ├── Role.php
│ ├── Comment.php
│ ├── DiscussionVisit.php
│ └── Reply.php
├── Providers
│ ├── BroadcastServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── EventServiceProvider.php
│ ├── RouteServiceProvider.php
│ └── AppServiceProvider.php
├── Forms
│ └── Components
│ │ └── MentionsRichEditor.php
├── Helpers
│ └── CustomUserAvatar.php
├── View
│ └── Components
│ │ ├── Layout.php
│ │ ├── Home
│ │ └── Tags.php
│ │ ├── LayoutProfile.php
│ │ └── Profile
│ │ └── Stats.php
├── Console
│ └── Kernel.php
├── Exceptions
│ └── Handler.php
└── Notifications
│ └── EmailNotification.php
├── resources
├── css
│ ├── filament.scss
│ └── app.scss
├── views
│ ├── partials
│ │ ├── layouts
│ │ │ └── profile
│ │ │ │ ├── roles-tags.blade.php
│ │ │ │ └── info.blade.php
│ │ ├── dialogs
│ │ │ ├── socials-icon
│ │ │ │ ├── facebook.blade.php
│ │ │ │ ├── google.blade.php
│ │ │ │ ├── twitter.blade.php
│ │ │ │ └── github.blade.php
│ │ │ ├── socials.blade.php
│ │ │ ├── login.blade.php
│ │ │ ├── sign-up.blade.php
│ │ │ └── add-discussion.blade.php
│ │ ├── loading-page.blade.php
│ │ ├── discussions
│ │ │ └── tags.blade.php
│ │ ├── home
│ │ │ └── side-menu.blade.php
│ │ └── profile
│ │ │ └── dialogs
│ │ │ ├── email.blade.php
│ │ │ ├── password.blade.php
│ │ │ └── username.blade.php
│ ├── profile
│ │ ├── likes.blade.php
│ │ ├── comments.blade.php
│ │ ├── replies.blade.php
│ │ ├── discussions.blade.php
│ │ ├── best-replies.blade.php
│ │ ├── ignoring-discussions.blade.php
│ │ ├── following-discussions.blade.php
│ │ └── not-following-discussions.blade.php
│ ├── livewire
│ │ ├── discussion
│ │ │ ├── reply-btn.blade.php
│ │ │ ├── lock.blade.php
│ │ │ ├── mark-as-resolved.blade.php
│ │ │ └── reply.blade.php
│ │ ├── profile
│ │ │ ├── details.blade.php
│ │ │ ├── dialogs
│ │ │ │ ├── email.blade.php
│ │ │ │ ├── password.blade.php
│ │ │ │ └── username.blade.php
│ │ │ ├── notifications.blade.php
│ │ │ ├── avatar.blade.php
│ │ │ └── discussions.blade.php
│ │ ├── layout
│ │ │ ├── dialogs
│ │ │ │ ├── register.blade.php
│ │ │ │ ├── login.blade.php
│ │ │ │ ├── discussion.blade.php
│ │ │ │ └── likes.blade.php
│ │ │ └── notifications.blade.php
│ │ ├── forgot-password.blade.php
│ │ └── just-registered.blade.php
│ ├── password-reset.blade.php
│ ├── registered.blade.php
│ ├── components
│ │ ├── home
│ │ │ └── tags.blade.php
│ │ └── layout-profile.blade.php
│ ├── tags.blade.php
│ ├── home.blade.php
│ ├── search.blade.php
│ ├── tag.blade.php
│ └── forms
│ │ └── components
│ │ └── mentions-rich-editor.blade.php
└── js
│ ├── app.js
│ └── bootstrap.js
├── .gitattributes
├── .gitignore
├── .editorconfig
├── vite.config.js
├── SECURITY.md
├── lang
└── en
│ ├── pagination.php
│ ├── auth.php
│ └── passwords.php
├── routes
├── channels.php
├── api.php
└── console.php
├── package.json
├── tailwind.config.js
├── config
├── cors.php
├── view.php
├── notifications.php
└── hashing.php
├── LICENSE.md
└── phpunit.xml
/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite*
2 |
--------------------------------------------------------------------------------
/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/logs/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/storage/app/public/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/app/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !public/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/storage/framework/testing/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/views/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/cache/data/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/sessions/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !data/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/github-contents/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaslanphp/forumium/HEAD/github-contents/1.jpg
--------------------------------------------------------------------------------
/github-contents/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaslanphp/forumium/HEAD/github-contents/2.jpg
--------------------------------------------------------------------------------
/github-contents/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaslanphp/forumium/HEAD/github-contents/3.jpg
--------------------------------------------------------------------------------
/github-contents/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaslanphp/forumium/HEAD/github-contents/4.png
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/tests/Unit/ExampleTest.php:
--------------------------------------------------------------------------------
1 | toBeTrue();
5 | });
6 |
--------------------------------------------------------------------------------
/tests/Feature/ExampleTest.php:
--------------------------------------------------------------------------------
1 | get('/');
5 |
6 | $response->assertStatus(200);
7 | });
8 |
--------------------------------------------------------------------------------
/app/Http/Controllers/ForgotPasswordController.php:
--------------------------------------------------------------------------------
1 |
2 | @foreach($user->roles as $role)
3 | {{ $role->name }}
4 | @endforeach
5 |
6 |
--------------------------------------------------------------------------------
/resources/views/profile/likes.blade.php:
--------------------------------------------------------------------------------
1 | @php($user = $user ?? auth()->user())
2 |
' . fake()->paragraphs(3, true) . '
', 23 | 'user_id' => User::all()->random()->id, 24 | 'discussion_id' => Discussion::all()->random()->id, 25 | 'is_best' => collect([true, false])->random(), 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 19 | } 20 | 21 | /** 22 | * Register the commands for the application. 23 | * 24 | * @return void 25 | */ 26 | protected function commands() 27 | { 28 | $this->load(__DIR__.'/Commands'); 29 | 30 | require base_path('routes/console.php'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2022_12_28_183737_add_is_public_to_discussions.php: -------------------------------------------------------------------------------- 1 | boolean('is_public'); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | Schema::table('discussions', function (Blueprint $table) { 28 | $table->dropColumn('is_public'); 29 | }); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /database/migrations/2022_12_29_091049_add_total_points_to_user.php: -------------------------------------------------------------------------------- 1 | bigInteger('total_points')->default(0); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | Schema::table('users', function (Blueprint $table) { 28 | $table->dropColumn('total_points'); 29 | }); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /database/migrations/2022_12_30_133311_add_meta_to_visits.php: -------------------------------------------------------------------------------- 1 | longText('meta')->nullable(); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | Schema::table('discussion_visits', function (Blueprint $table) { 28 | $table->dropColumn('meta'); 29 | }); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /database/migrations/2022_12_28_135432_add_best_answer_to_replies.php: -------------------------------------------------------------------------------- 1 | boolean('is_best')->default(false); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('replies', function (Blueprint $table) { 29 | $table->dropColumn('is_best'); 30 | }); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Your password has been reset!', 17 | 'sent' => 'We have emailed your password reset link!', 18 | 'throttled' => 'Please wait before retrying.', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that email address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /database/migrations/2022_12_30_102655_add_locked_flag_to_discussions.php: -------------------------------------------------------------------------------- 1 | boolean('is_locked')->default(false); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | Schema::table('discussions', function (Blueprint $table) { 28 | $table->dropColumn('is_locked'); 29 | }); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /database/migrations/2022_12_22_124442_create_notifications_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('name'); 18 | $table->timestamps(); 19 | $table->softDeletes(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('app_notifications'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2022_12_24_141352_add_resolved_flag_to_discussions.php: -------------------------------------------------------------------------------- 1 | boolean('is_resolved')->default(false); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | Schema::table('discussions', function (Blueprint $table) { 28 | $table->dropColumn('is_resolved'); 29 | }); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /database/migrations/2022_12_23_103652_create_likes_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignId('user_id')->constrained('users'); 19 | $table->morphs('source'); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('likes'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2022_12_22_100059_create_user_roles_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignId('user_id')->constrained('users'); 19 | $table->foreignId('role_id')->constrained('roles'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('user_roles'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2022_12_28_182630_create_configurations_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->boolean('is_enabled'); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('configurations'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /database/seeders/Referential/ConfigurationSeeder.php: -------------------------------------------------------------------------------- 1 | "Enable registration", 13 | "is_enabled" => true 14 | ], 15 | [ 16 | "name" => "Enable public discussions", 17 | "is_enabled" => true 18 | ], 19 | ]; 20 | 21 | /** 22 | * Run the database seeds. 23 | * 24 | * @return void 25 | */ 26 | public function run() 27 | { 28 | foreach ($this->data as $item) { 29 | if (!Configuration::where('name', $item['name'])->count()) { 30 | Configuration::create($item); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /resources/views/livewire/layout/dialogs/login.blade.php: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /database/migrations/2022_12_22_145752_create_discussion_tags_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignId('discussion_id')->constrained('discussions'); 19 | $table->foreignId('tag_id')->constrained('tags'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('discussion_tags'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2022_12_22_095913_create_permissions_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('name'); 18 | $table->longText('description'); 19 | $table->timestamps(); 20 | $table->softDeletes(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('permissions'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /database/migrations/2022_12_22_100105_create_role_permissions_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignId('role_id')->constrained('roles'); 19 | $table->foreignId('permission_id')->constrained('permissions'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('role_permissions'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2022_12_22_143642_create_tags_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->string('color'); 20 | $table->string('icon'); 21 | $table->timestamps(); 22 | $table->softDeletes(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('tags'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /database/migrations/2022_12_23_082707_create_followers_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->foreignId('user_id')->constrained('users'); 18 | $table->foreignId('discussion_id')->constrained('discussions'); 19 | $table->string('type'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('followers'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2022_12_22_095906_create_roles_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->string('color'); 20 | $table->longText('description'); 21 | $table->timestamps(); 22 | $table->softDeletes(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('roles'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /app/Http/Livewire/Discussion/MarkAsResolved.php: -------------------------------------------------------------------------------- 1 | discussion->is_resolved = !$this->discussion->is_resolved; 21 | $this->discussion->save(); 22 | Filament::notify( 23 | 'success', 24 | match ($this->discussion->is_resolved) { 25 | true => 'Discussion marked as resolved.', 26 | false => 'Discussion reopened.' 27 | } 28 | ); 29 | $this->emit('resolvedFlagUpdated'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/migrations/2022_12_30_122531_create_discussion_visits_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignId('user_id')->constrained('users'); 19 | $table->foreignId('discussion_id')->constrained('discussions'); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('discussion_visits'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "vite", 5 | "build": "vite build" 6 | }, 7 | "devDependencies": { 8 | "@awcodes/alpine-floating-ui": "^3.4.0", 9 | "@fortawesome/fontawesome-free": "^6.2.1", 10 | "@tailwindcss/forms": "^0.5.3", 11 | "@tailwindcss/jit": "^0.1.18", 12 | "@tailwindcss/typography": "^0.5.8", 13 | "alpinejs": "^3.10.5", 14 | "autoprefixer": "^10.4.13", 15 | "axios": "^1.1.2", 16 | "flowbite": "^1.5.5", 17 | "laravel-vite-plugin": "^0.7.2", 18 | "lodash": "^4.17.19", 19 | "postcss": "^8.4.20", 20 | "sass": "^1.57.1", 21 | "tailwindcss": "^3.2.4", 22 | "tailwindcss-textshadow": "^2.1.3", 23 | "vite": "^4.0.0" 24 | }, 25 | "dependencies": { 26 | "@thoughtbot/trix-mentions-element": "^0.1.2", 27 | "tributejs": "^5.1.3" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | const colors = require('tailwindcss/colors') 3 | 4 | module.exports = { 5 | mode: 'jit', 6 | content: [ 7 | './resources/**/*.blade.php', 8 | './resources/**/*.js', 9 | './node_modules/flowbite/**/*.js', 10 | './vendor/filament/**/*.blade.php', 11 | './app/Http/Livewire/**/*.php', 12 | './app/Filament/Resources/**/*.php' 13 | ], 14 | theme: { 15 | extend: { 16 | colors: { 17 | danger: colors.rose, 18 | primary: colors.blue, 19 | success: colors.green, 20 | warning: colors.yellow, 21 | }, 22 | }, 23 | }, 24 | plugins: [ 25 | require('flowbite/plugin'), 26 | require('@tailwindcss/forms'), 27 | require('@tailwindcss/typography'), 28 | require('tailwindcss-textshadow') 29 | ], 30 | } 31 | -------------------------------------------------------------------------------- /database/factories/DiscussionFactory.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | class DiscussionFactory extends Factory 13 | { 14 | /** 15 | * Define the model's default state. 16 | * 17 | * @return array' . fake()->paragraphs(3, true) . '
', 24 | 'user_id' => User::all()->random()->id, 25 | 'is_resolved' => collect([true, false])->random(), 26 | 'is_public' => collect([true, false])->random(), 27 | 'is_locked' => collect([true, false])->random(), 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /database/migrations/2022_12_29_085520_create_points_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignId('user_id')->constrained('users'); 19 | $table->string('type'); 20 | $table->morphs('source'); 21 | $table->integer('value'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('points'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /app/Models/Comment.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class, 'user_id', 'id'); 23 | } 24 | 25 | public function source(): MorphTo 26 | { 27 | return $this->morphTo(); 28 | } 29 | 30 | public function likes(): MorphMany 31 | { 32 | return $this->morphMany(Like::class, 'source'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2022_12_23_081648_create_comments_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->longText('content'); 19 | $table->foreignId('user_id')->constrained('users'); 20 | $table->morphs('source'); 21 | $table->timestamps(); 22 | $table->softDeletes(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('comments'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /database/migrations/2022_12_22_145655_create_discussions_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->string('name'); 18 | $table->longText('content'); 19 | $table->foreignId('user_id')->constrained('users'); 20 | $table->timestamps(); 21 | $table->softDeletes(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('discussions'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /database/migrations/2022_12_30_122544_add_visits_to_discussions.php: -------------------------------------------------------------------------------- 1 | bigInteger('visits')->default(0); 18 | $table->bigInteger('unique_visits')->default(0); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::table('discussions', function (Blueprint $table) { 30 | $table->dropColumn('visits'); 31 | $table->dropColumn('unique_visits'); 32 | }); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /app/Http/Livewire/Layout/Dialogs/Likes.php: -------------------------------------------------------------------------------- 1 | initData(); 22 | } 23 | 24 | public function render() 25 | { 26 | return view('livewire.layout.dialogs.likes'); 27 | } 28 | 29 | public function likesUpdated(int $id) 30 | { 31 | if ($this->model->id == $id) { 32 | $this->model->refresh(); 33 | $this->initData(); 34 | } 35 | } 36 | 37 | private function initData() 38 | { 39 | $this->likes = $this->model->likes->sortByDesc('created_at'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /resources/views/livewire/forgot-password.blade.php: -------------------------------------------------------------------------------- 1 |Platform admins
", 19 | ], 20 | [ 21 | "name" => "Mod", 22 | "color" => "#ae1de0", 23 | "description" => "Platform mods
", 24 | ], 25 | [ 26 | "name" => "Member", 27 | "color" => "#1dc9e0", 28 | "description" => "Platform members
", 29 | ], 30 | ]; 31 | 32 | /** 33 | * Run the database seeds. 34 | * 35 | * @return void 36 | */ 37 | public function run() 38 | { 39 | foreach ($this->data as $item) { 40 | if (!Role::where('name', $item['name'])->count()) { 41 | Role::create($item); 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 |