├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── .gitpod.Dockerfile ├── .gitpod.yml ├── .styleci.yml ├── README.md ├── app ├── Actions │ ├── Fortify │ │ ├── CreateNewUser.php │ │ ├── PasswordValidationRules.php │ │ ├── ResetUserPassword.php │ │ ├── UpdateUserPassword.php │ │ └── UpdateUserProfileInformation.php │ └── Jetstream │ │ ├── AddTeamMember.php │ │ ├── CreateTeam.php │ │ ├── DeleteTeam.php │ │ ├── DeleteUser.php │ │ └── UpdateTeamName.php ├── Console │ ├── Commands │ │ └── LivewireCustomCrudCommand.php │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ └── Controller.php │ ├── Kernel.php │ ├── Livewire │ │ ├── ChatComponent.php │ │ ├── Frontpage.php │ │ ├── NavigationMenus.php │ │ ├── Pages.php │ │ ├── UserPermissions.php │ │ └── Users.php │ └── Middleware │ │ ├── Authenticate.php │ │ ├── EncryptCookies.php │ │ ├── EnsureUserRoleIsAllowedToAccess.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustHosts.php │ │ ├── TrustProxies.php │ │ └── VerifyCsrfToken.php ├── Models │ ├── Membership.php │ ├── Message.php │ ├── NavigationMenu.php │ ├── Page.php │ ├── Team.php │ ├── User.php │ └── UserPermission.php ├── Policies │ └── TeamPolicy.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ ├── FortifyServiceProvider.php │ ├── JetstreamServiceProvider.php │ └── RouteServiceProvider.php └── View │ └── Components │ ├── AppLayout.php │ └── GuestLayout.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── cors.php ├── database.php ├── filesystems.php ├── fortify.php ├── hashing.php ├── jetstream.php ├── laravel-trix.php ├── logging.php ├── mail.php ├── queue.php ├── sanctum.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2014_10_12_200000_add_two_factor_columns_to_users_table.php │ ├── 2019_08_19_000000_create_failed_jobs_table.php │ ├── 2019_12_14_000001_create_personal_access_tokens_table.php │ ├── 2020_05_21_100000_create_teams_table.php │ ├── 2020_05_21_200000_create_team_user_table.php │ ├── 2020_10_15_081242_create_sessions_table.php │ ├── 2020_10_25_145528_create_pages_table.php │ ├── 2020_10_25_150627_create_trix_rich_texts_table.php │ ├── 2020_11_07_161745_add_set_default_pages_to_pages_table.php │ ├── 2020_12_23_113233_create_navigation_menus_table.php │ ├── 2021_01_04_051353_add_role_to_users_table.php │ ├── 2021_01_18_040001_create_user_permissions_table.php │ └── 2021_03_07_085741_create_messages_table.php └── seeders │ └── DatabaseSeeder.php ├── package-lock.json ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── css │ ├── app.css │ └── chat.css ├── favicon.ico ├── img │ └── logo.svg ├── index.php ├── js │ ├── app.js │ └── socket.js ├── mix-manifest.json ├── robots.txt └── web.config ├── resources ├── css │ └── app.css ├── js │ ├── app.js │ └── bootstrap.js ├── lang │ └── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ ├── admin │ ├── navigation-menus.blade.php │ ├── pages.blade.php │ ├── user-permissions.blade.php │ └── users.blade.php │ ├── api │ ├── api-token-manager.blade.php │ └── index.blade.php │ ├── auth │ ├── forgot-password.blade.php │ ├── login.blade.php │ ├── register.blade.php │ ├── reset-password.blade.php │ ├── two-factor-challenge.blade.php │ └── verify-email.blade.php │ ├── dashboard.blade.php │ ├── layouts │ ├── app.blade.php │ ├── frontpage.blade.php │ └── guest.blade.php │ ├── livewire │ ├── chat-component.blade.php │ ├── frontpage.blade.php │ ├── navigation-menus.blade.php │ ├── pages.blade.php │ ├── user-permissions.blade.php │ └── users.blade.php │ ├── navigation-dropdown.blade.php │ ├── profile │ ├── delete-user-form.blade.php │ ├── logout-other-browser-sessions-form.blade.php │ ├── show.blade.php │ ├── two-factor-authentication-form.blade.php │ ├── update-password-form.blade.php │ └── update-profile-information-form.blade.php │ ├── teams │ ├── create-team-form.blade.php │ ├── create.blade.php │ ├── delete-team-form.blade.php │ ├── show.blade.php │ ├── team-member-manager.blade.php │ └── update-team-name-form.blade.php │ ├── vendor │ └── jetstream │ │ └── components │ │ ├── action-message.blade.php │ │ ├── action-section.blade.php │ │ ├── application-logo.blade.php │ │ ├── application-mark.blade.php │ │ ├── authentication-card-logo.blade.php │ │ ├── authentication-card.blade.php │ │ ├── button.blade.php │ │ ├── confirmation-modal.blade.php │ │ ├── confirms-password.blade.php │ │ ├── danger-button.blade.php │ │ ├── dialog-modal.blade.php │ │ ├── dropdown-link.blade.php │ │ ├── dropdown.blade.php │ │ ├── form-section.blade.php │ │ ├── input-error.blade.php │ │ ├── input.blade.php │ │ ├── label.blade.php │ │ ├── modal.blade.php │ │ ├── nav-link.blade.php │ │ ├── responsive-nav-link.blade.php │ │ ├── secondary-button.blade.php │ │ ├── section-border.blade.php │ │ ├── section-title.blade.php │ │ ├── switchable-team.blade.php │ │ ├── validation-errors.blade.php │ │ └── welcome.blade.php │ └── welcome.blade.php ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── server.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── stubs ├── console.stub ├── controller.api.stub ├── controller.invokable.stub ├── controller.model.api.stub ├── controller.model.stub ├── controller.nested.api.stub ├── controller.nested.stub ├── controller.plain.stub ├── controller.stub ├── custom.livewire.crud.stub ├── custom.livewire.crud.view.stub ├── factory.stub ├── job.queued.stub ├── job.stub ├── middleware.stub ├── migration.create.stub ├── migration.stub ├── migration.update.stub ├── model.pivot.stub ├── model.stub ├── policy.plain.stub ├── policy.stub ├── request.stub ├── resource-collection.stub ├── resource.stub ├── rule.stub ├── seeder.stub ├── test.stub └── test.unit.stub ├── tailwind.config.js ├── tests ├── CreatesApplication.php ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php ├── webpack.mix.js └── websocket ├── .gitignore ├── chatServer.js ├── eventNotificationServer.js ├── package-lock.json └── package.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_style = space 8 | indent_size = 4 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | 9 | DB_CONNECTION=mysql 10 | DB_HOST=127.0.0.1 11 | DB_PORT=3306 12 | DB_DATABASE=laravel 13 | DB_USERNAME=root 14 | DB_PASSWORD= 15 | 16 | BROADCAST_DRIVER=log 17 | CACHE_DRIVER=file 18 | QUEUE_CONNECTION=sync 19 | SESSION_DRIVER=database 20 | SESSION_LIFETIME=120 21 | 22 | REDIS_HOST=127.0.0.1 23 | REDIS_PASSWORD=null 24 | REDIS_PORT=6379 25 | 26 | MAIL_MAILER=smtp 27 | MAIL_HOST=smtp.mailtrap.io 28 | MAIL_PORT=2525 29 | MAIL_USERNAME=null 30 | MAIL_PASSWORD=null 31 | MAIL_ENCRYPTION=null 32 | MAIL_FROM_ADDRESS=null 33 | MAIL_FROM_NAME="${APP_NAME}" 34 | 35 | AWS_ACCESS_KEY_ID= 36 | AWS_SECRET_ACCESS_KEY= 37 | AWS_DEFAULT_REGION=us-east-1 38 | AWS_BUCKET= 39 | 40 | PUSHER_APP_ID= 41 | PUSHER_APP_KEY= 42 | PUSHER_APP_SECRET= 43 | PUSHER_APP_CLUSTER=mt1 44 | 45 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 46 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 47 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/hot 3 | /public/storage 4 | /storage/*.key 5 | /vendor 6 | .env 7 | .env.backup 8 | .phpunit.result.cache 9 | Homestead.json 10 | Homestead.yaml 11 | npm-debug.log 12 | yarn-error.log 13 | -------------------------------------------------------------------------------- /.gitpod.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gitpod/workspace-full 2 | 3 | # Install custom tools, runtimes, etc. 4 | # For example "bastet", a command-line tetris clone: 5 | # RUN brew install bastet 6 | # 7 | # More information: https://www.gitpod.io/docs/config-docker/ 8 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | image: 2 | file: .gitpod.Dockerfile 3 | 4 | tasks: 5 | - init: composer install 6 | command: composer install ; php artisan key:generate ; php artisan migrate ; php artisan serv 7 | -------------------------------------------------------------------------------- /.styleci.yml: -------------------------------------------------------------------------------- 1 | php: 2 | preset: laravel 3 | disabled: 4 | - no_unused_imports 5 | finder: 6 | not-name: 7 | - index.php 8 | - server.php 9 | js: 10 | finder: 11 | not-name: 12 | - webpack.mix.js 13 | css: true 14 | -------------------------------------------------------------------------------- /app/Actions/Fortify/CreateNewUser.php: -------------------------------------------------------------------------------- 1 | ['required', 'string', 'max:255'], 26 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 27 | 'password' => $this->passwordRules(), 28 | ])->validate(); 29 | 30 | return DB::transaction(function () use ($input) { 31 | return tap(User::create([ 32 | 'name' => $input['name'], 33 | 'email' => $input['email'], 34 | 'password' => Hash::make($input['password']), 35 | ]), function (User $user) { 36 | $this->createTeam($user); 37 | }); 38 | }); 39 | } 40 | 41 | /** 42 | * Create a personal team for the user. 43 | * 44 | * @param \App\Models\User $user 45 | * @return void 46 | */ 47 | protected function createTeam(User $user) 48 | { 49 | $user->ownedTeams()->save(Team::forceCreate([ 50 | 'user_id' => $user->id, 51 | 'name' => explode(' ', $user->name, 2)[0]."'s Team", 52 | 'personal_team' => true, 53 | ])); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/Actions/Fortify/PasswordValidationRules.php: -------------------------------------------------------------------------------- 1 | $this->passwordRules(), 24 | ])->validate(); 25 | 26 | $user->forceFill([ 27 | 'password' => Hash::make($input['password']), 28 | ])->save(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Actions/Fortify/UpdateUserPassword.php: -------------------------------------------------------------------------------- 1 | ['required', 'string'], 24 | 'password' => $this->passwordRules(), 25 | ])->after(function ($validator) use ($user, $input) { 26 | if (! Hash::check($input['current_password'], $user->password)) { 27 | $validator->errors()->add('current_password', __('The provided password does not match your current password.')); 28 | } 29 | })->validateWithBag('updatePassword'); 30 | 31 | $user->forceFill([ 32 | 'password' => Hash::make($input['password']), 33 | ])->save(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Actions/Fortify/UpdateUserProfileInformation.php: -------------------------------------------------------------------------------- 1 | ['required', 'string', 'max:255'], 23 | 'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)], 24 | 'photo' => ['nullable', 'image', 'max:1024'], 25 | ])->validateWithBag('updateProfileInformation'); 26 | 27 | if (isset($input['photo'])) { 28 | $user->updateProfilePhoto($input['photo']); 29 | } 30 | 31 | if ($input['email'] !== $user->email && 32 | $user instanceof MustVerifyEmail) { 33 | $this->updateVerifiedUser($user, $input); 34 | } else { 35 | $user->forceFill([ 36 | 'name' => $input['name'], 37 | 'email' => $input['email'], 38 | ])->save(); 39 | } 40 | } 41 | 42 | /** 43 | * Update the given verified user's profile information. 44 | * 45 | * @param mixed $user 46 | * @param array $input 47 | * @return void 48 | */ 49 | protected function updateVerifiedUser($user, array $input) 50 | { 51 | $user->forceFill([ 52 | 'name' => $input['name'], 53 | 'email' => $input['email'], 54 | 'email_verified_at' => null, 55 | ])->save(); 56 | 57 | $user->sendEmailVerificationNotification(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/Actions/Jetstream/AddTeamMember.php: -------------------------------------------------------------------------------- 1 | authorize('addTeamMember', $team); 26 | 27 | $this->validate($team, $email, $role); 28 | 29 | $team->users()->attach( 30 | $newTeamMember = Jetstream::findUserByEmailOrFail($email), 31 | ['role' => $role] 32 | ); 33 | 34 | TeamMemberAdded::dispatch($team, $newTeamMember); 35 | } 36 | 37 | /** 38 | * Validate the add member operation. 39 | * 40 | * @param mixed $team 41 | * @param string $email 42 | * @param string|null $role 43 | * @return void 44 | */ 45 | protected function validate($team, string $email, ?string $role) 46 | { 47 | Validator::make([ 48 | 'email' => $email, 49 | 'role' => $role, 50 | ], $this->rules(), [ 51 | 'email.exists' => __('We were unable to find a registered user with this email address.'), 52 | ])->after( 53 | $this->ensureUserIsNotAlreadyOnTeam($team, $email) 54 | )->validateWithBag('addTeamMember'); 55 | } 56 | 57 | /** 58 | * Get the validation rules for adding a team member. 59 | * 60 | * @return array 61 | */ 62 | protected function rules() 63 | { 64 | return array_filter([ 65 | 'email' => ['required', 'email', 'exists:users'], 66 | 'role' => Jetstream::hasRoles() 67 | ? ['required', 'string', new Role] 68 | : null, 69 | ]); 70 | } 71 | 72 | /** 73 | * Ensure that the user is not already on the team. 74 | * 75 | * @param mixed $team 76 | * @param string $email 77 | * @return \Closure 78 | */ 79 | protected function ensureUserIsNotAlreadyOnTeam($team, string $email) 80 | { 81 | return function ($validator) use ($team, $email) { 82 | $validator->errors()->addIf( 83 | $team->hasUserWithEmail($email), 84 | 'email', 85 | __('This user already belongs to the team.') 86 | ); 87 | }; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /app/Actions/Jetstream/CreateTeam.php: -------------------------------------------------------------------------------- 1 | authorize('create', Jetstream::newTeamModel()); 22 | 23 | Validator::make($input, [ 24 | 'name' => ['required', 'string', 'max:255'], 25 | ])->validateWithBag('createTeam'); 26 | 27 | return $user->ownedTeams()->create([ 28 | 'name' => $input['name'], 29 | 'personal_team' => false, 30 | ]); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Actions/Jetstream/DeleteTeam.php: -------------------------------------------------------------------------------- 1 | purge(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Actions/Jetstream/DeleteUser.php: -------------------------------------------------------------------------------- 1 | deletesTeams = $deletesTeams; 27 | } 28 | 29 | /** 30 | * Delete the given user. 31 | * 32 | * @param mixed $user 33 | * @return void 34 | */ 35 | public function delete($user) 36 | { 37 | DB::transaction(function () use ($user) { 38 | $this->deleteTeams($user); 39 | 40 | $user->delete(); 41 | }); 42 | } 43 | 44 | /** 45 | * Delete the teams and team associations attached to the user. 46 | * 47 | * @param mixed $user 48 | * @return void 49 | */ 50 | protected function deleteTeams($user) 51 | { 52 | $user->teams()->detach(); 53 | 54 | $user->ownedTeams->each(function ($team) { 55 | $this->deletesTeams->delete($team); 56 | }); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/Actions/Jetstream/UpdateTeamName.php: -------------------------------------------------------------------------------- 1 | authorize('update', $team); 22 | 23 | Validator::make($input, [ 24 | 'name' => ['required', 'string', 'max:255'], 25 | ])->validateWithBag('updateTeamName'); 26 | 27 | $team->forceFill([ 28 | 'name' => $input['name'], 29 | ])->save(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 28 | } 29 | 30 | /** 31 | * Register the commands for the application. 32 | * 33 | * @return void 34 | */ 35 | protected function commands() 36 | { 37 | $this->load(__DIR__.'/Commands'); 38 | 39 | require base_path('routes/console.php'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | [ 33 | \App\Http\Middleware\EncryptCookies::class, 34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 35 | \Illuminate\Session\Middleware\StartSession::class, 36 | \Laravel\Jetstream\Http\Middleware\AuthenticateSession::class, 37 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 38 | \App\Http\Middleware\VerifyCsrfToken::class, 39 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 40 | ], 41 | 42 | 'api' => [ 43 | 'throttle:api', 44 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 45 | ], 46 | ]; 47 | 48 | /** 49 | * The application's route middleware. 50 | * 51 | * These middleware may be assigned to groups or used individually. 52 | * 53 | * @var array 54 | */ 55 | protected $routeMiddleware = [ 56 | 'auth' => \App\Http\Middleware\Authenticate::class, 57 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 58 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 59 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 60 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 61 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 62 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 63 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 64 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 65 | 'accessrole' => \App\Http\Middleware\EnsureUserRoleIsAllowedToAccess::class, 66 | ]; 67 | } 68 | -------------------------------------------------------------------------------- /app/Http/Livewire/ChatComponent.php: -------------------------------------------------------------------------------- 1 | user()->id, [1, 2])) { // Room for Billy and Adrian 24 | $this->roomId = 1; 25 | } else { // Room for Richard and John 26 | $this->roomId = 2; 27 | } 28 | 29 | // Sets the initial state of the chat popup during page load or reload 30 | $this->chatPopupVisibility = Cookie::get('chatPopupShow') == 'true' ? true : false; 31 | } 32 | 33 | /** 34 | * Shows the chat popup box 35 | * 36 | * @return void 37 | */ 38 | public function showChatPopup() 39 | { 40 | Cookie::queue('chatPopupShow', 'true', 60); 41 | $this->chatPopupVisibility = true; 42 | 43 | // load chat history by reloading the page 44 | $this->dispatchBrowserEvent('reload-page'); 45 | } 46 | 47 | /** 48 | * Hides the chat popup box 49 | * 50 | * @return void 51 | */ 52 | public function closeChatPopup() 53 | { 54 | Cookie::queue('chatPopupShow', 'false', 60); 55 | $this->chatPopupVisibility = false; 56 | } 57 | 58 | /** 59 | * Sends the chat message 60 | * 61 | * @return void 62 | */ 63 | public function sendMessage() 64 | { 65 | $userId = auth()->user()->id; 66 | 67 | // Save the message 68 | Message::create([ 69 | 'room_id' => $this->roomId, 70 | 'user_id' => $userId, 71 | 'message' => $this->message, 72 | ]); 73 | 74 | // Remove the value of the message after saving 75 | $this->message = ""; 76 | 77 | // Prompt the server that we sent a message 78 | $this->dispatchBrowserEvent('chat-send-message', [ 79 | 'room_id' => $this->roomId, 80 | 'user_id' => $userId, 81 | ]); 82 | } 83 | 84 | public function render() 85 | { 86 | return view('livewire.chat-component'); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /app/Http/Livewire/Frontpage.php: -------------------------------------------------------------------------------- 1 | retrieveContent($urlslug); 23 | } 24 | 25 | /** 26 | * Retrieves the content of the page. 27 | * 28 | * @param mixed $urlslug 29 | * @return void 30 | */ 31 | public function retrieveContent($urlslug) 32 | { 33 | // Get home page if slug is empty 34 | if (empty($urlslug)) { 35 | $data = Page::where('is_default_home', true)->first(); 36 | } else { 37 | 38 | // Get the page according to the slug value 39 | $data = Page::where('slug', $urlslug)->first(); 40 | 41 | // If we can't retrieve anything, let's get the default 404 not found page 42 | if (!$data) { 43 | $data = Page::where('is_default_not_found', true)->first(); 44 | } 45 | } 46 | 47 | $this->title = $data->title; 48 | $this->content = $data->content; 49 | } 50 | 51 | /** 52 | * Gets all the sidebar links. 53 | * 54 | * @return void 55 | */ 56 | private function sideBarLinks() 57 | { 58 | return DB::table('navigation_menus') 59 | ->where('type', '=', 'SidebarNav') 60 | ->orderBy('sequence', 'asc') 61 | ->orderBy('created_at', 'asc') 62 | ->get(); 63 | } 64 | 65 | /** 66 | * Get the top navigation links. 67 | * 68 | * @return void 69 | */ 70 | private function topNavLinks() 71 | { 72 | return DB::table('navigation_menus') 73 | ->where('type', '=', 'TopNav') 74 | ->orderBy('sequence', 'asc') 75 | ->orderBy('created_at', 'asc') 76 | ->get(); 77 | } 78 | 79 | /** 80 | * The livewire render function. 81 | * 82 | * @return void 83 | */ 84 | public function render() 85 | { 86 | return view('livewire.frontpage', [ 87 | 'sideBarLinks' => $this->sideBarLinks(), 88 | 'topNavLinks' => $this->topNavLinks(), 89 | ])->layout('layouts.frontpage'); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /app/Http/Livewire/Users.php: -------------------------------------------------------------------------------- 1 | 'required', 32 | 'name' => 'required', 33 | ]; 34 | } 35 | 36 | /** 37 | * Loads the model data 38 | * of this component. 39 | * 40 | * @return void 41 | */ 42 | public function loadModel() 43 | { 44 | $data = User::find($this->modelId); 45 | $this->role = $data->role; 46 | $this->name = $data->name; 47 | } 48 | 49 | /** 50 | * The data for the model mapped 51 | * in this component. 52 | * 53 | * @return void 54 | */ 55 | public function modelData() 56 | { 57 | return [ 58 | 'role' => $this->role, 59 | 'name' => $this->name, 60 | ]; 61 | } 62 | 63 | /** 64 | * The create function. 65 | * 66 | * @return void 67 | */ 68 | public function create() 69 | { 70 | $this->validate(); 71 | User::create($this->modelData()); 72 | $this->modalFormVisible = false; 73 | $this->reset(); 74 | } 75 | 76 | /** 77 | * The read function. 78 | * 79 | * @return void 80 | */ 81 | public function read() 82 | { 83 | return User::paginate(5); 84 | } 85 | 86 | /** 87 | * The update function 88 | * 89 | * @return void 90 | */ 91 | public function update() 92 | { 93 | $this->validate(); 94 | User::find($this->modelId)->update($this->modelData()); 95 | $this->modalFormVisible = false; 96 | } 97 | 98 | /** 99 | * The delete function. 100 | * 101 | * @return void 102 | */ 103 | public function delete() 104 | { 105 | User::destroy($this->modelId); 106 | $this->modalConfirmDeleteVisible = false; 107 | $this->resetPage(); 108 | } 109 | 110 | /** 111 | * Shows the create modal 112 | * 113 | * @return void 114 | */ 115 | public function createShowModal() 116 | { 117 | $this->resetValidation(); 118 | $this->reset(); 119 | $this->modalFormVisible = true; 120 | } 121 | 122 | /** 123 | * Shows the form modal 124 | * in update mode. 125 | * 126 | * @param mixed $id 127 | * @return void 128 | */ 129 | public function updateShowModal($id) 130 | { 131 | $this->resetValidation(); 132 | $this->reset(); 133 | $this->modalFormVisible = true; 134 | $this->modelId = $id; 135 | $this->loadModel(); 136 | } 137 | 138 | /** 139 | * Shows the delete confirmation modal. 140 | * 141 | * @param mixed $id 142 | * @return void 143 | */ 144 | public function deleteShowModal($id) 145 | { 146 | $this->modelId = $id; 147 | $this->modalConfirmDeleteVisible = true; 148 | } 149 | 150 | public function render() 151 | { 152 | return view('livewire.users', [ 153 | 'data' => $this->read(), 154 | ]); 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | user()->role; 25 | $currentRouteName = Route::currentRouteName(); 26 | 27 | if (UserPermission::isRoleHasRightToAccess($userRole, $currentRouteName) 28 | || in_array($currentRouteName, $this->defaultUserAccessRole()[$userRole])) { 29 | return $next($request); 30 | } else { 31 | abort(403, 'Unauthorized action.'); 32 | } 33 | } catch (\Throwable $th) { 34 | abort(403, 'Unauthorized action.'); 35 | } 36 | } 37 | 38 | /** 39 | * The default user access role. 40 | * 41 | * @return void 42 | */ 43 | private function defaultUserAccessRole() 44 | { 45 | return [ 46 | 'admin' => [ 47 | 'user-permissions', 48 | ], 49 | ]; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/Http/Middleware/PreventRequestsDuringMaintenance.php: -------------------------------------------------------------------------------- 1 | check()) { 26 | return redirect(RouteServiceProvider::HOME); 27 | } 28 | } 29 | 30 | return $next($request); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | allSubdomainsOfApplicationUrl(), 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | 'boolean', 19 | ]; 20 | 21 | /** 22 | * The attributes that are mass assignable. 23 | * 24 | * @var array 25 | */ 26 | protected $fillable = [ 27 | 'name', 28 | 'personal_team', 29 | ]; 30 | 31 | /** 32 | * The event map for the model. 33 | * 34 | * @var array 35 | */ 36 | protected $dispatchesEvents = [ 37 | 'created' => TeamCreated::class, 38 | 'updated' => TeamUpdated::class, 39 | 'deleted' => TeamDeleted::class, 40 | ]; 41 | } 42 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | 'datetime', 50 | ]; 51 | 52 | /** 53 | * The accessors to append to the model's array form. 54 | * 55 | * @var array 56 | */ 57 | protected $appends = [ 58 | 'profile_photo_url', 59 | ]; 60 | 61 | /** 62 | * The list of user roles 63 | * 64 | * @return void 65 | */ 66 | public static function userRoleList() 67 | { 68 | return [ 69 | 'admin' => 'Admin', 70 | 'user' => 'User', 71 | ]; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/Models/UserPermission.php: -------------------------------------------------------------------------------- 1 | where('route_name', $routeName) 41 | ->first(); 42 | 43 | return $model ? true : false; 44 | } catch (\Throwable $th) { 45 | return false; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/Policies/TeamPolicy.php: -------------------------------------------------------------------------------- 1 | belongsToTeam($team); 34 | } 35 | 36 | /** 37 | * Determine whether the user can create models. 38 | * 39 | * @param \App\Models\User $user 40 | * @return mixed 41 | */ 42 | public function create(User $user) 43 | { 44 | return true; 45 | } 46 | 47 | /** 48 | * Determine whether the user can update the model. 49 | * 50 | * @param \App\Models\User $user 51 | * @param \App\Models\Team $team 52 | * @return mixed 53 | */ 54 | public function update(User $user, Team $team) 55 | { 56 | return $user->ownsTeam($team); 57 | } 58 | 59 | /** 60 | * Determine whether the user can add team members. 61 | * 62 | * @param \App\Models\User $user 63 | * @param \App\Models\Team $team 64 | * @return mixed 65 | */ 66 | public function addTeamMember(User $user, Team $team) 67 | { 68 | return $user->ownsTeam($team); 69 | } 70 | 71 | /** 72 | * Determine whether the user can update team member permissions. 73 | * 74 | * @param \App\Models\User $user 75 | * @param \App\Models\Team $team 76 | * @return mixed 77 | */ 78 | public function updateTeamMember(User $user, Team $team) 79 | { 80 | return $user->ownsTeam($team); 81 | } 82 | 83 | /** 84 | * Determine whether the user can remove team members. 85 | * 86 | * @param \App\Models\User $user 87 | * @param \App\Models\Team $team 88 | * @return mixed 89 | */ 90 | public function removeTeamMember(User $user, Team $team) 91 | { 92 | return $user->ownsTeam($team); 93 | } 94 | 95 | /** 96 | * Determine whether the user can delete the model. 97 | * 98 | * @param \App\Models\User $user 99 | * @param \App\Models\Team $team 100 | * @return mixed 101 | */ 102 | public function delete(User $user, Team $team) 103 | { 104 | return $user->ownsTeam($team); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | TeamPolicy::class, 18 | ]; 19 | 20 | /** 21 | * Register any authentication / authorization services. 22 | * 23 | * @return void 24 | */ 25 | public function boot() 26 | { 27 | $this->registerPolicies(); 28 | 29 | // 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | * 26 | * @return void 27 | */ 28 | public function boot() 29 | { 30 | // 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Providers/FortifyServiceProvider.php: -------------------------------------------------------------------------------- 1 | configurePermissions(); 33 | 34 | Jetstream::createTeamsUsing(CreateTeam::class); 35 | Jetstream::updateTeamNamesUsing(UpdateTeamName::class); 36 | Jetstream::addTeamMembersUsing(AddTeamMember::class); 37 | Jetstream::deleteTeamsUsing(DeleteTeam::class); 38 | Jetstream::deleteUsersUsing(DeleteUser::class); 39 | } 40 | 41 | /** 42 | * Configure the roles and permissions that are available within the application. 43 | * 44 | * @return void 45 | */ 46 | protected function configurePermissions() 47 | { 48 | Jetstream::defaultApiTokenPermissions(['read']); 49 | 50 | Jetstream::role('admin', __('Administrator'), [ 51 | 'create', 52 | 'read', 53 | 'update', 54 | 'delete', 55 | ])->description(__('Administrator users can perform any action.')); 56 | 57 | Jetstream::role('editor', __('Editor'), [ 58 | 'read', 59 | 'create', 60 | 'update', 61 | ])->description(__('Editor users have the ability to read, create, and update.')); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | configureRateLimiting(); 39 | 40 | $this->routes(function () { 41 | Route::prefix('api') 42 | ->middleware('api') 43 | ->namespace($this->namespace) 44 | ->group(base_path('routes/api.php')); 45 | 46 | Route::middleware('web') 47 | ->namespace($this->namespace) 48 | ->group(base_path('routes/web.php')); 49 | }); 50 | } 51 | 52 | /** 53 | * Configure the rate limiters for the application. 54 | * 55 | * @return void 56 | */ 57 | protected function configureRateLimiting() 58 | { 59 | RateLimiter::for('api', function (Request $request) { 60 | return Limit::perMinute(60); 61 | }); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/View/Components/AppLayout.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "The Laravel Framework.", 5 | "keywords": [ 6 | "framework", 7 | "laravel" 8 | ], 9 | "license": "MIT", 10 | "require": { 11 | "php": "^7.3", 12 | "fideloper/proxy": "^4.2", 13 | "fruitcake/laravel-cors": "^2.0", 14 | "guzzlehttp/guzzle": "^7.0.1", 15 | "laravel/framework": "^8.0", 16 | "laravel/jetstream": "^1.4", 17 | "laravel/sanctum": "^2.6", 18 | "laravel/tinker": "^2.0", 19 | "livewire/livewire": "^2.0", 20 | "te7a-houdini/laravel-trix": "^2.0" 21 | }, 22 | "require-dev": { 23 | "facade/ignition": "^2.3.6", 24 | "fzaninotto/faker": "^1.9.1", 25 | "mockery/mockery": "^1.3.1", 26 | "nunomaduro/collision": "^5.0", 27 | "phpunit/phpunit": "^9.3" 28 | }, 29 | "config": { 30 | "optimize-autoloader": true, 31 | "preferred-install": "dist", 32 | "sort-packages": true 33 | }, 34 | "extra": { 35 | "laravel": { 36 | "dont-discover": [] 37 | } 38 | }, 39 | "autoload": { 40 | "psr-4": { 41 | "App\\": "app/", 42 | "Database\\Factories\\": "database/factories/", 43 | "Database\\Seeders\\": "database/seeders/" 44 | } 45 | }, 46 | "autoload-dev": { 47 | "psr-4": { 48 | "Tests\\": "tests/" 49 | } 50 | }, 51 | "minimum-stability": "dev", 52 | "prefer-stable": true, 53 | "scripts": { 54 | "post-autoload-dump": [ 55 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 56 | "@php artisan package:discover --ansi" 57 | ], 58 | "post-root-package-install": [ 59 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 60 | ], 61 | "post-create-project-cmd": [ 62 | "@php artisan key:generate --ansi" 63 | ] 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'useTLS' => true, 41 | ], 42 | ], 43 | 44 | 'redis' => [ 45 | 'driver' => 'redis', 46 | 'connection' => 'default', 47 | ], 48 | 49 | 'log' => [ 50 | 'driver' => 'log', 51 | ], 52 | 53 | 'null' => [ 54 | 'driver' => 'null', 55 | ], 56 | 57 | ], 58 | 59 | ]; 60 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Cache Stores 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Here you may define all of the cache "stores" for your application as 29 | | well as their drivers. You may even define multiple stores for the 30 | | same cache driver to group types of items stored in your caches. 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'apc' => [ 37 | 'driver' => 'apc', 38 | ], 39 | 40 | 'array' => [ 41 | 'driver' => 'array', 42 | 'serialize' => false, 43 | ], 44 | 45 | 'database' => [ 46 | 'driver' => 'database', 47 | 'table' => 'cache', 48 | 'connection' => null, 49 | ], 50 | 51 | 'file' => [ 52 | 'driver' => 'file', 53 | 'path' => storage_path('framework/cache/data'), 54 | ], 55 | 56 | 'memcached' => [ 57 | 'driver' => 'memcached', 58 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 59 | 'sasl' => [ 60 | env('MEMCACHED_USERNAME'), 61 | env('MEMCACHED_PASSWORD'), 62 | ], 63 | 'options' => [ 64 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 65 | ], 66 | 'servers' => [ 67 | [ 68 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 69 | 'port' => env('MEMCACHED_PORT', 11211), 70 | 'weight' => 100, 71 | ], 72 | ], 73 | ], 74 | 75 | 'redis' => [ 76 | 'driver' => 'redis', 77 | 'connection' => 'cache', 78 | ], 79 | 80 | 'dynamodb' => [ 81 | 'driver' => 'dynamodb', 82 | 'key' => env('AWS_ACCESS_KEY_ID'), 83 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 84 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 85 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 86 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 87 | ], 88 | 89 | ], 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Cache Key Prefix 94 | |-------------------------------------------------------------------------- 95 | | 96 | | When utilizing a RAM based store such as APC or Memcached, there might 97 | | be other applications utilizing the same cache. So, we'll specify a 98 | | value to get prefixed to all our keys so we can avoid collisions. 99 | | 100 | */ 101 | 102 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), 103 | 104 | ]; 105 | -------------------------------------------------------------------------------- /config/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => [], 29 | 30 | 'max_age' => 0, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DRIVER', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Cloud Filesystem Disk 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Many applications store files both locally and in the cloud. For this 24 | | reason, you may specify a default "cloud" driver here. This driver 25 | | will be bound as the Cloud disk implementation in the container. 26 | | 27 | */ 28 | 29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Filesystem Disks 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may configure as many filesystem "disks" as you wish, and you 37 | | may even configure multiple disks of the same driver. Defaults have 38 | | been setup for each driver as an example of the required options. 39 | | 40 | | Supported Drivers: "local", "ftp", "sftp", "s3" 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'url' => env('APP_URL').'/storage', 55 | 'visibility' => 'public', 56 | ], 57 | 58 | 's3' => [ 59 | 'driver' => 's3', 60 | 'key' => env('AWS_ACCESS_KEY_ID'), 61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 62 | 'region' => env('AWS_DEFAULT_REGION'), 63 | 'bucket' => env('AWS_BUCKET'), 64 | 'url' => env('AWS_URL'), 65 | 'endpoint' => env('AWS_ENDPOINT'), 66 | ], 67 | 68 | ], 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Symbolic Links 73 | |-------------------------------------------------------------------------- 74 | | 75 | | Here you may configure the symbolic links that will be created when the 76 | | `storage:link` Artisan command is executed. The array keys should be 77 | | the locations of the links and the values should be their targets. 78 | | 79 | */ 80 | 81 | 'links' => [ 82 | public_path('storage') => storage_path('app/public'), 83 | ], 84 | 85 | ]; 86 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 1024, 48 | 'threads' => 2, 49 | 'time' => 2, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /config/jetstream.php: -------------------------------------------------------------------------------- 1 | 'livewire', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Features 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Some of Jetstream's features are optional. You may disable the features 26 | | by removing them from this array. You're free to only remove some of 27 | | these features or you can even remove all of these if you need to. 28 | | 29 | */ 30 | 31 | 'features' => [ 32 | // Features::profilePhotos(), 33 | // Features::api(), 34 | Features::teams(), 35 | ], 36 | 37 | ]; 38 | -------------------------------------------------------------------------------- /config/laravel-trix.php: -------------------------------------------------------------------------------- 1 | env('LARAVEL_TRIX_STORAGE_DISK', 'public'), 5 | 6 | 'store_attachment_action' => Te7aHoudini\LaravelTrix\Http\Controllers\TrixAttachmentController::class.'@store', 7 | 8 | 'destroy_attachment_action' => Te7aHoudini\LaravelTrix\Http\Controllers\TrixAttachmentController::class.'@destroy', 9 | ]; 10 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 21 | 22 | /* 23 | |-------------------------------------------------------------------------- 24 | | Log Channels 25 | |-------------------------------------------------------------------------- 26 | | 27 | | Here you may configure the log channels for your application. Out of 28 | | the box, Laravel uses the Monolog PHP logging library. This gives 29 | | you a variety of powerful log handlers / formatters to utilize. 30 | | 31 | | Available Drivers: "single", "daily", "slack", "syslog", 32 | | "errorlog", "monolog", 33 | | "custom", "stack" 34 | | 35 | */ 36 | 37 | 'channels' => [ 38 | 'stack' => [ 39 | 'driver' => 'stack', 40 | 'channels' => ['single'], 41 | 'ignore_exceptions' => false, 42 | ], 43 | 44 | 'single' => [ 45 | 'driver' => 'single', 46 | 'path' => storage_path('logs/laravel.log'), 47 | 'level' => env('LOG_LEVEL', 'debug'), 48 | ], 49 | 50 | 'daily' => [ 51 | 'driver' => 'daily', 52 | 'path' => storage_path('logs/laravel.log'), 53 | 'level' => env('LOG_LEVEL', 'debug'), 54 | 'days' => 14, 55 | ], 56 | 57 | 'slack' => [ 58 | 'driver' => 'slack', 59 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 60 | 'username' => 'Laravel Log', 61 | 'emoji' => ':boom:', 62 | 'level' => env('LOG_LEVEL', 'critical'), 63 | ], 64 | 65 | 'papertrail' => [ 66 | 'driver' => 'monolog', 67 | 'level' => env('LOG_LEVEL', 'debug'), 68 | 'handler' => SyslogUdpHandler::class, 69 | 'handler_with' => [ 70 | 'host' => env('PAPERTRAIL_URL'), 71 | 'port' => env('PAPERTRAIL_PORT'), 72 | ], 73 | ], 74 | 75 | 'stderr' => [ 76 | 'driver' => 'monolog', 77 | 'handler' => StreamHandler::class, 78 | 'formatter' => env('LOG_STDERR_FORMATTER'), 79 | 'with' => [ 80 | 'stream' => 'php://stderr', 81 | ], 82 | ], 83 | 84 | 'syslog' => [ 85 | 'driver' => 'syslog', 86 | 'level' => env('LOG_LEVEL', 'debug'), 87 | ], 88 | 89 | 'errorlog' => [ 90 | 'driver' => 'errorlog', 91 | 'level' => env('LOG_LEVEL', 'debug'), 92 | ], 93 | 94 | 'null' => [ 95 | 'driver' => 'monolog', 96 | 'handler' => NullHandler::class, 97 | ], 98 | 99 | 'emergency' => [ 100 | 'path' => storage_path('logs/laravel.log'), 101 | ], 102 | ], 103 | 104 | ]; 105 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'sync'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection information for each server that 24 | | is used by your application. A default configuration has been added 25 | | for each back-end shipped with Laravel. You are free to add more. 26 | | 27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | ], 43 | 44 | 'beanstalkd' => [ 45 | 'driver' => 'beanstalkd', 46 | 'host' => 'localhost', 47 | 'queue' => 'default', 48 | 'retry_after' => 90, 49 | 'block_for' => 0, 50 | ], 51 | 52 | 'sqs' => [ 53 | 'driver' => 'sqs', 54 | 'key' => env('AWS_ACCESS_KEY_ID'), 55 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 56 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 57 | 'queue' => env('SQS_QUEUE', 'your-queue-name'), 58 | 'suffix' => env('SQS_SUFFIX'), 59 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 60 | ], 61 | 62 | 'redis' => [ 63 | 'driver' => 'redis', 64 | 'connection' => 'default', 65 | 'queue' => env('REDIS_QUEUE', 'default'), 66 | 'retry_after' => 90, 67 | 'block_for' => null, 68 | ], 69 | 70 | ], 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | Failed Queue Jobs 75 | |-------------------------------------------------------------------------- 76 | | 77 | | These options configure the behavior of failed queue job logging so you 78 | | can control which database and table are used to store the jobs that 79 | | have failed. You may change them to any database / table you wish. 80 | | 81 | */ 82 | 83 | 'failed' => [ 84 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 85 | 'database' => env('DB_CONNECTION', 'mysql'), 86 | 'table' => 'failed_jobs', 87 | ], 88 | 89 | ]; 90 | -------------------------------------------------------------------------------- /config/sanctum.php: -------------------------------------------------------------------------------- 1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', 'localhost,127.0.0.1,127.0.0.1:8000,::1')), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Expiration Minutes 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This value controls the number of minutes until an issued token will be 24 | | considered expired. If this value is null, personal access tokens do 25 | | not expire. This won't tweak the lifetime of first-party sessions. 26 | | 27 | */ 28 | 29 | 'expiration' => null, 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Sanctum Middleware 34 | |-------------------------------------------------------------------------- 35 | | 36 | | When authenticating your first-party SPA with Sanctum you may need to 37 | | customize some of the middleware Sanctum uses while processing the 38 | | request. You may change the middleware listed below as required. 39 | | 40 | */ 41 | 42 | 'middleware' => [ 43 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, 44 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, 45 | ], 46 | 47 | ]; 48 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | ], 22 | 23 | 'postmark' => [ 24 | 'token' => env('POSTMARK_TOKEN'), 25 | ], 26 | 27 | 'ses' => [ 28 | 'key' => env('AWS_ACCESS_KEY_ID'), 29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 31 | ], 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | *.sqlite-journal 3 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->name, 27 | 'email' => $this->faker->unique()->safeEmail, 28 | 'email_verified_at' => now(), 29 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 30 | 'remember_token' => Str::random(10), 31 | ]; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->timestamp('email_verified_at')->nullable(); 21 | $table->string('password'); 22 | $table->rememberToken(); 23 | $table->foreignId('current_team_id')->nullable(); 24 | $table->text('profile_photo_path')->nullable(); 25 | $table->timestamps(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | * 32 | * @return void 33 | */ 34 | public function down() 35 | { 36 | Schema::dropIfExists('users'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /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/2014_10_12_200000_add_two_factor_columns_to_users_table.php: -------------------------------------------------------------------------------- 1 | text('two_factor_secret') 18 | ->after('password') 19 | ->nullable(); 20 | 21 | $table->text('two_factor_recovery_codes') 22 | ->after('two_factor_secret') 23 | ->nullable(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::table('users', function (Blueprint $table) { 35 | $table->dropColumn('two_factor_secret', 'two_factor_recovery_codes'); 36 | }); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /database/migrations/2019_08_19_000000_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('uuid')->unique(); 19 | $table->text('connection'); 20 | $table->text('queue'); 21 | $table->longText('payload'); 22 | $table->longText('exception'); 23 | $table->timestamp('failed_at')->useCurrent(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('failed_jobs'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->morphs('tokenable'); 19 | $table->string('name'); 20 | $table->string('token', 64)->unique(); 21 | $table->text('abilities')->nullable(); 22 | $table->timestamp('last_used_at')->nullable(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('personal_access_tokens'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2020_05_21_100000_create_teams_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignId('user_id')->index(); 19 | $table->string('name'); 20 | $table->boolean('personal_team'); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::drop('teams'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2020_05_21_200000_create_team_user_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignId('team_id'); 19 | $table->foreignId('user_id'); 20 | $table->string('role')->nullable(); 21 | $table->timestamps(); 22 | 23 | $table->unique(['team_id', 'user_id']); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::drop('team_user'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2020_10_15_081242_create_sessions_table.php: -------------------------------------------------------------------------------- 1 | string('id')->primary(); 18 | $table->foreignId('user_id')->nullable()->index(); 19 | $table->string('ip_address', 45)->nullable(); 20 | $table->text('user_agent')->nullable(); 21 | $table->text('payload'); 22 | $table->integer('last_activity')->index(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('sessions'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2020_10_25_145528_create_pages_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('title')->nullable(); 19 | $table->string('slug')->nullable(); 20 | $table->longText('content')->nullable(); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('pages'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2020_10_25_150627_create_trix_rich_texts_table.php: -------------------------------------------------------------------------------- 1 | unsignedBigInteger('id')->autoIncrement(); 18 | $table->string('field'); 19 | $table->morphs('model'); 20 | $table->text('content')->nullable(); 21 | $table->timestamps(); 22 | }); 23 | 24 | Schema::create('trix_attachments', function (Blueprint $table) { 25 | $table->unsignedBigInteger('id')->autoIncrement(); 26 | $table->string('field'); 27 | $table->unsignedInteger('attachable_id')->nullable(); 28 | $table->string('attachable_type'); 29 | $table->string('attachment'); 30 | $table->string('disk'); 31 | $table->boolean('is_pending')->default(1); 32 | $table->timestamps(); 33 | }); 34 | } 35 | 36 | /** 37 | * Reverse the migrations. 38 | * 39 | * @return void 40 | */ 41 | public function down() 42 | { 43 | Schema::drop('trix_attachments'); 44 | Schema::drop('trix_rich_texts'); 45 | } 46 | } -------------------------------------------------------------------------------- /database/migrations/2020_11_07_161745_add_set_default_pages_to_pages_table.php: -------------------------------------------------------------------------------- 1 | boolean('is_default_home')->nullable()->after('id'); 18 | $table->boolean('is_default_not_found')->nullable()->after('is_default_home'); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::table('pages', function (Blueprint $table) { 30 | // 31 | }); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/migrations/2020_12_23_113233_create_navigation_menus_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->integer('sequence'); 19 | $table->enum('type', ['SidebarNav', 'TopNav']); 20 | $table->string('label'); 21 | $table->string('slug'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('navigation_menus'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2021_01_04_051353_add_role_to_users_table.php: -------------------------------------------------------------------------------- 1 | string('role')->default('user')->after('id'); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('users', function (Blueprint $table) { 29 | // 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2021_01_18_040001_create_user_permissions_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('role')->nullable(); 19 | $table->string('route_name')->nullable(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('user_permissions'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/migrations/2021_03_07_085741_create_messages_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->bigInteger('room_id'); 19 | $table->bigInteger('user_id'); 20 | $table->text('message'); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('messages'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch": "npm run development -- --watch", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "@tailwindcss/ui": "^0.6.0", 14 | "axios": "^0.19", 15 | "browser-sync": "2.26.13", 16 | "browser-sync-webpack-plugin": "2.0.1", 17 | "cross-env": "^7.0", 18 | "laravel-mix": "^5.0.1", 19 | "lodash": "^4.17.19", 20 | "postcss-import": "^12.0.1", 21 | "resolve-url-loader": "^3.1.0", 22 | "tailwindcss": "^1.8.0", 23 | "vue-template-compiler": "2.6.12" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | ./tests/Unit 10 | 11 | 12 | ./tests/Feature 13 | 14 | 15 | 16 | 17 | ./app 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Send Requests To Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /public/css/chat.css: -------------------------------------------------------------------------------- 1 | /* Button used to open the chat form - fixed at the bottom of the page */ 2 | .open-button { 3 | background-color: #555; 4 | color: white; 5 | padding: 16px 20px; 6 | border: none; 7 | cursor: pointer; 8 | opacity: 0.8; 9 | position: fixed; 10 | bottom: 23px; 11 | right: 28px; 12 | width: 280px; 13 | } 14 | 15 | /* The popup chat - hidden by default */ 16 | .chat-popup { 17 | position: fixed; 18 | bottom: 0; 19 | right: 15px; 20 | border: 3px solid #f1f1f1; 21 | z-index: 9; 22 | } 23 | 24 | /* Add styles to the form container */ 25 | .form-container { 26 | max-width: 300px; 27 | padding: 10px; 28 | background-color: white; 29 | } 30 | 31 | /* Full-width textarea */ 32 | .form-container textarea { 33 | width: 100%; 34 | padding: 15px; 35 | margin: 5px 0 22px 0; 36 | border: none; 37 | background: #f1f1f1; 38 | resize: none; 39 | min-height: 100px; 40 | } 41 | 42 | /* Set a style for the submit/send button */ 43 | .form-container .btn { 44 | background-color: #4caf50; 45 | color: white; 46 | padding: 16px 20px; 47 | border: none; 48 | cursor: pointer; 49 | width: 100%; 50 | margin-bottom: 10px; 51 | opacity: 0.8; 52 | } 53 | 54 | /* Add a red background color to the cancel button */ 55 | .form-container .cancel { 56 | background-color: red; 57 | } 58 | 59 | /* Add some hover effects to buttons */ 60 | .form-container .btn:hover, 61 | .open-button:hover { 62 | opacity: 1; 63 | } 64 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackoftraits/laravel8-with-livewire/734a1e3a13253a5fd2b0ab7dd6acf63dab51de0d/public/favicon.ico -------------------------------------------------------------------------------- /public/img/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class); 50 | 51 | $response = tap($kernel->handle( 52 | $request = Request::capture() 53 | ))->send(); 54 | 55 | $kernel->terminate($request, $response); 56 | -------------------------------------------------------------------------------- /public/js/socket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Initilize a web socket client 3 | */ 4 | function clientSocket(config = {}) { 5 | let route = config.route || "127.0.0.1"; 6 | let port = config.port || "3280"; 7 | window.Websocket = window.WebSocket || window.MozWebSocket; 8 | return new WebSocket("ws://" + route + ":" + port); 9 | } 10 | -------------------------------------------------------------------------------- /public/mix-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "/js/app.js": "/js/app.js", 3 | "/css/app.css": "/css/app.css" 4 | } 5 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /resources/css/app.css: -------------------------------------------------------------------------------- 1 | @import "tailwindcss/base"; 2 | @import "tailwindcss/components"; 3 | @import "tailwindcss/utilities"; 4 | 5 | .body-content { 6 | max-height: 300px !important; 7 | overflow-y: scroll; 8 | } 9 | 10 | .trix-button-group--history-tools { 11 | display: none !important; 12 | } 13 | 14 | .error { 15 | color: red; 16 | } 17 | -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | require('./bootstrap'); 2 | -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | window._ = require('lodash'); 2 | 3 | /** 4 | * We'll load the axios HTTP library which allows us to easily issue requests 5 | * to our Laravel back-end. This library automatically handles sending the 6 | * CSRF token as a header based on the value of the "XSRF" token cookie. 7 | */ 8 | 9 | window.axios = require('axios'); 10 | 11 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 12 | 13 | /** 14 | * Echo exposes an expressive API for subscribing to channels and listening 15 | * for events that are broadcast by Laravel. Echo and event broadcasting 16 | * allows your team to easily build robust real-time web applications. 17 | */ 18 | 19 | // import Echo from 'laravel-echo'; 20 | 21 | // window.Pusher = require('pusher-js'); 22 | 23 | // window.Echo = new Echo({ 24 | // broadcaster: 'pusher', 25 | // key: process.env.MIX_PUSHER_APP_KEY, 26 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER, 27 | // forceTLS: true 28 | // }); 29 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/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 | -------------------------------------------------------------------------------- /resources/views/admin/navigation-menus.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('Navigation Menus') }} 5 |

6 |
7 | 8 |
9 |
10 |
11 | @livewire('navigation-menus') 12 |
13 |
14 |
15 |
-------------------------------------------------------------------------------- /resources/views/admin/pages.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('Pages') }} 5 |

6 |
7 | 8 |
9 |
10 |
11 | @livewire('pages') 12 |
13 |
14 |
15 |
-------------------------------------------------------------------------------- /resources/views/admin/user-permissions.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('User Permissions') }} 5 |

6 |
7 | 8 |
9 |
10 |
11 | @livewire('user-permissions') 12 |
13 |
14 |
15 |
-------------------------------------------------------------------------------- /resources/views/admin/users.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('Users') }} 5 |

6 |
7 | 8 |
9 |
10 |
11 | @livewire('users') 12 |
13 |
14 |
15 |
-------------------------------------------------------------------------------- /resources/views/api/index.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('API Tokens') }} 5 |

6 |
7 | 8 |
9 |
10 | @livewire('api.api-token-manager') 11 |
12 |
13 |
14 | -------------------------------------------------------------------------------- /resources/views/auth/forgot-password.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | {{ __('Forgot your password? No problem. Just let us know your email address and we will email you a password reset link that will allow you to choose a new one.') }} 9 |
10 | 11 | @if (session('status')) 12 |
13 | {{ session('status') }} 14 |
15 | @endif 16 | 17 | 18 | 19 |
20 | @csrf 21 | 22 |
23 | 24 | 25 |
26 | 27 |
28 | 29 | {{ __('Email Password Reset Link') }} 30 | 31 |
32 |
33 |
34 |
35 | -------------------------------------------------------------------------------- /resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | @if (session('status')) 10 |
11 | {{ session('status') }} 12 |
13 | @endif 14 | 15 |
16 | @csrf 17 | 18 |
19 | 20 | 21 |
22 | 23 |
24 | 25 | 26 |
27 | 28 |
29 | 33 |
34 | 35 |
36 | @if (Route::has('password.request')) 37 | 38 | {{ __('Forgot your password?') }} 39 | 40 | @endif 41 | 42 | 43 | {{ __('Login') }} 44 | 45 |
46 |
47 |
48 |
49 | -------------------------------------------------------------------------------- /resources/views/auth/register.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | @csrf 11 | 12 |
13 | 14 | 15 |
16 | 17 |
18 | 19 | 20 |
21 | 22 |
23 | 24 | 25 |
26 | 27 |
28 | 29 | 30 |
31 | 32 |
33 | 34 | {{ __('Already registered?') }} 35 | 36 | 37 | 38 | {{ __('Register') }} 39 | 40 |
41 |
42 |
43 |
44 | -------------------------------------------------------------------------------- /resources/views/auth/reset-password.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | @csrf 11 | 12 | 13 | 14 |
15 | 16 | 17 |
18 | 19 |
20 | 21 | 22 |
23 | 24 |
25 | 26 | 27 |
28 | 29 |
30 | 31 | {{ __('Reset Password') }} 32 | 33 |
34 |
35 |
36 |
37 | -------------------------------------------------------------------------------- /resources/views/auth/two-factor-challenge.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 | {{ __('Please confirm access to your account by entering the authentication code provided by your authenticator application.') }} 10 |
11 | 12 |
13 | {{ __('Please confirm access to your account by entering one of your emergency recovery codes.') }} 14 |
15 | 16 | 17 | 18 |
19 | @csrf 20 | 21 |
22 | 23 | 24 |
25 | 26 |
27 | 28 | 29 |
30 | 31 |
32 | 40 | 41 | 49 | 50 | 51 | {{ __('Login') }} 52 | 53 |
54 |
55 |
56 |
57 |
58 | -------------------------------------------------------------------------------- /resources/views/auth/verify-email.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | {{ __('Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn\'t receive the email, we will gladly send you another.') }} 9 |
10 | 11 | @if (session('status') == 'verification-link-sent') 12 |
13 | {{ __('A new verification link has been sent to the email address you provided during registration.') }} 14 |
15 | @endif 16 | 17 |
18 |
19 | @csrf 20 | 21 |
22 | 23 | {{ __('Resend Verification Email') }} 24 | 25 |
26 |
27 | 28 |
29 | @csrf 30 | 31 | 34 |
35 |
36 |
37 |
38 | -------------------------------------------------------------------------------- /resources/views/dashboard.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('Dashboard') }} 5 |

6 |
7 | 8 |
9 |
10 |
11 | 12 |
13 |
14 |
15 |
16 | -------------------------------------------------------------------------------- /resources/views/layouts/frontpage.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ config('app.name', 'Laravel') }} 9 | 10 | 11 | 12 | 13 | 14 | 15 | @livewireStyles 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 |
25 | {{ $slot }} 26 |
27 |
28 | 29 | @stack('modals') 30 | 31 | @livewireScripts 32 | 33 | 34 | -------------------------------------------------------------------------------- /resources/views/layouts/guest.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ config('app.name', 'Laravel') }} 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | {{ $slot }} 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /resources/views/profile/delete-user-form.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ __('Delete Account') }} 4 | 5 | 6 | 7 | {{ __('Permanently delete your account.') }} 8 | 9 | 10 | 11 |
12 | {{ __('Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.') }} 13 |
14 | 15 |
16 | 17 | {{ __('Delete Account') }} 18 | 19 |
20 | 21 | 22 | 23 | 24 | {{ __('Delete Account') }} 25 | 26 | 27 | 28 | {{ __('Are you sure you want to delete your account? Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.') }} 29 | 30 |
31 | 35 | 36 | 37 |
38 |
39 | 40 | 41 | 42 | {{ __('Nevermind') }} 43 | 44 | 45 | 46 | {{ __('Delete Account') }} 47 | 48 | 49 |
50 |
51 |
52 | -------------------------------------------------------------------------------- /resources/views/profile/show.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('Profile') }} 5 |

6 |
7 | 8 |
9 |
10 | @if (Laravel\Fortify\Features::enabled(Laravel\Fortify\Features::updateProfileInformation())) 11 | @livewire('profile.update-profile-information-form') 12 | 13 | 14 | @endif 15 | 16 | @if (Laravel\Fortify\Features::enabled(Laravel\Fortify\Features::updatePasswords())) 17 |
18 | @livewire('profile.update-password-form') 19 |
20 | 21 | 22 | @endif 23 | 24 | @if (Laravel\Fortify\Features::canManageTwoFactorAuthentication()) 25 |
26 | @livewire('profile.two-factor-authentication-form') 27 |
28 | 29 | 30 | @endif 31 | 32 |
33 | @livewire('profile.logout-other-browser-sessions-form') 34 |
35 | 36 | 37 | 38 |
39 | @livewire('profile.delete-user-form') 40 |
41 |
42 |
43 |
44 | -------------------------------------------------------------------------------- /resources/views/profile/update-password-form.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ __('Update Password') }} 4 | 5 | 6 | 7 | {{ __('Ensure your account is using a long, random password to stay secure.') }} 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 |
18 | 19 | 20 | 21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 |
29 | 30 | 31 | 32 | {{ __('Saved.') }} 33 | 34 | 35 | 36 | {{ __('Save') }} 37 | 38 | 39 |
40 | -------------------------------------------------------------------------------- /resources/views/profile/update-profile-information-form.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ __('Profile Information') }} 4 | 5 | 6 | 7 | {{ __('Update your account\'s profile information and email address.') }} 8 | 9 | 10 | 11 | 12 | @if (Laravel\Jetstream\Jetstream::managesProfilePhotos()) 13 |
14 | 15 | 26 | 27 | 28 | 29 | 30 |
31 | {{ $this->user->name }} 32 |
33 | 34 | 35 |
36 | 38 | 39 |
40 | 41 | 42 | {{ __('Select A New Photo') }} 43 | 44 | 45 | @if ($this->user->profile_photo_path) 46 | 47 | {{ __('Remove Photo') }} 48 | 49 | @endif 50 | 51 | 52 |
53 | @endif 54 | 55 | 56 |
57 | 58 | 59 | 60 |
61 | 62 | 63 |
64 | 65 | 66 | 67 |
68 |
69 | 70 | 71 | 72 | {{ __('Saved.') }} 73 | 74 | 75 | 76 | {{ __('Save') }} 77 | 78 | 79 |
80 | -------------------------------------------------------------------------------- /resources/views/teams/create-team-form.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ __('Team Details') }} 4 | 5 | 6 | 7 | {{ __('Create a new team to collaborate with others on projects.') }} 8 | 9 | 10 | 11 |
12 | 13 | 14 |
15 | {{ $this->user->name }} 16 | 17 |
18 |
{{ $this->user->name }}
19 |
{{ $this->user->email }}
20 |
21 |
22 |
23 | 24 |
25 | 26 | 27 | 28 |
29 |
30 | 31 | 32 | 33 | {{ __('Create') }} 34 | 35 | 36 |
37 | -------------------------------------------------------------------------------- /resources/views/teams/create.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('Create Team') }} 5 |

6 |
7 | 8 |
9 |
10 | @livewire('teams.create-team-form') 11 |
12 |
13 |
14 | -------------------------------------------------------------------------------- /resources/views/teams/delete-team-form.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ __('Delete Team') }} 4 | 5 | 6 | 7 | {{ __('Permanently delete this team.') }} 8 | 9 | 10 | 11 |
12 | {{ __('Once a team is deleted, all of its resources and data will be permanently deleted. Before deleting this team, please download any data or information regarding this team that you wish to retain.') }} 13 |
14 | 15 |
16 | 17 | {{ __('Delete Team') }} 18 | 19 |
20 | 21 | 22 | 23 | 24 | {{ __('Delete Team') }} 25 | 26 | 27 | 28 | {{ __('Are you sure you want to delete this team? Once a team is deleted, all of its resources and data will be permanently deleted.') }} 29 | 30 | 31 | 32 | 33 | {{ __('Nevermind') }} 34 | 35 | 36 | 37 | {{ __('Delete Team') }} 38 | 39 | 40 | 41 |
42 |
43 | -------------------------------------------------------------------------------- /resources/views/teams/show.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('Team Settings') }} 5 |

6 |
7 | 8 |
9 |
10 | @livewire('teams.update-team-name-form', ['team' => $team]) 11 | 12 | @livewire('teams.team-member-manager', ['team' => $team]) 13 | 14 | @if (Gate::check('delete', $team) && ! $team->personal_team) 15 | 16 | 17 |
18 | @livewire('teams.delete-team-form', ['team' => $team]) 19 |
20 | @endif 21 |
22 |
23 |
24 | -------------------------------------------------------------------------------- /resources/views/teams/update-team-name-form.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ __('Team Name') }} 4 | 5 | 6 | 7 | {{ __('The team\'s name and owner information.') }} 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 |
16 | {{ $team->owner->name }} 17 | 18 |
19 |
{{ $team->owner->name }}
20 |
{{ $team->owner->email }}
21 |
22 |
23 |
24 | 25 | 26 |
27 | 28 | 29 | 34 | 35 | 36 |
37 |
38 | 39 | @if (Gate::check('update', $team)) 40 | 41 | 42 | {{ __('Saved.') }} 43 | 44 | 45 | 46 | {{ __('Save') }} 47 | 48 | 49 | @endif 50 |
51 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/action-message.blade.php: -------------------------------------------------------------------------------- 1 | @props(['on']) 2 | 3 |
merge(['class' => 'text-sm text-gray-600']) }}> 8 | {{ $slot ?? 'Saved.' }} 9 |
10 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/action-section.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | {{ $title }} 4 | {{ $description }} 5 | 6 | 7 |
8 |
9 | {{ $content }} 10 |
11 |
12 |
13 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/application-logo.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/application-mark.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/authentication-card-logo.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/authentication-card.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ $logo }} 4 |
5 | 6 |
7 | {{ $slot }} 8 |
9 |
10 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/button.blade.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/confirmation-modal.blade.php: -------------------------------------------------------------------------------- 1 | @props(['id' => null, 'maxWidth' => null]) 2 | 3 | 4 |
5 |
6 |
7 | 8 | 9 | 10 |
11 | 12 |
13 |

14 | {{ $title }} 15 |

16 | 17 |
18 | {{ $content }} 19 |
20 |
21 |
22 |
23 | 24 |
25 | {{ $footer }} 26 |
27 |
28 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/confirms-password.blade.php: -------------------------------------------------------------------------------- 1 | @props(['title' => __('Confirm Password'), 'content' => __('For your security, please confirm your password to continue.'), 'button' => __('Confirm')]) 2 | 3 | @php 4 | $confirmableId = md5($attributes->wire('then')); 5 | @endphp 6 | 7 | wire('then') }} 9 | x-data 10 | x-ref="span" 11 | x-on:click="$wire.startConfirmingPassword('{{ $confirmableId }}')" 12 | x-on:password-confirmed.window="setTimeout(() => $event.detail.id === '{{ $confirmableId }}' && $refs.span.dispatchEvent(new CustomEvent('then', { bubbles: false })), 250);" 13 | > 14 | {{ $slot }} 15 | 16 | 17 | @once 18 | 19 | 20 | {{ $title }} 21 | 22 | 23 | 24 | {{ $content }} 25 | 26 |
27 | 31 | 32 | 33 |
34 |
35 | 36 | 37 | 38 | {{ __('Nevermind') }} 39 | 40 | 41 | 42 | {{ $button }} 43 | 44 | 45 |
46 | @endonce 47 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/danger-button.blade.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/dialog-modal.blade.php: -------------------------------------------------------------------------------- 1 | @props(['id' => null, 'maxWidth' => null]) 2 | 3 | 4 |
5 |
6 | {{ $title }} 7 |
8 | 9 |
10 | {{ $content }} 11 |
12 |
13 | 14 |
15 | {{ $footer }} 16 |
17 |
18 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/dropdown-link.blade.php: -------------------------------------------------------------------------------- 1 | merge(['class' => 'block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 transition duration-150 ease-in-out']) }}>{{ $slot }} 2 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/dropdown.blade.php: -------------------------------------------------------------------------------- 1 | @props(['align' => 'right', 'width' => '48', 'contentClasses' => 'py-1 bg-white']) 2 | 3 | @php 4 | switch ($align) { 5 | case 'left': 6 | $alignmentClasses = 'origin-top-left left-0'; 7 | break; 8 | case 'top': 9 | $alignmentClasses = 'origin-top'; 10 | break; 11 | case 'right': 12 | default: 13 | $alignmentClasses = 'origin-top-right right-0'; 14 | break; 15 | } 16 | 17 | switch ($width) { 18 | case '48': 19 | $width = 'w-48'; 20 | break; 21 | } 22 | @endphp 23 | 24 |
25 |
26 | {{ $trigger }} 27 |
28 | 29 | 43 |
44 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/form-section.blade.php: -------------------------------------------------------------------------------- 1 | @props(['submit']) 2 | 3 |
merge(['class' => 'md:grid md:grid-cols-3 md:gap-6']) }}> 4 | 5 | {{ $title }} 6 | {{ $description }} 7 | 8 | 9 |
10 |
11 |
12 |
13 |
14 | {{ $form }} 15 |
16 |
17 | 18 | @if (isset($actions)) 19 |
20 | {{ $actions }} 21 |
22 | @endif 23 |
24 |
25 |
26 |
27 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/input-error.blade.php: -------------------------------------------------------------------------------- 1 | @props(['for']) 2 | 3 | @error($for) 4 |

merge(['class' => 'text-sm text-red-600']) }}>{{ $message }}

5 | @enderror 6 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/input.blade.php: -------------------------------------------------------------------------------- 1 | @props(['disabled' => false]) 2 | 3 | merge(['class' => 'form-input rounded-md shadow-sm']) !!}> 4 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/label.blade.php: -------------------------------------------------------------------------------- 1 | @props(['value']) 2 | 3 | 6 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/modal.blade.php: -------------------------------------------------------------------------------- 1 | @props(['id', 'maxWidth']) 2 | 3 | @php 4 | $id = $id ?? md5($attributes->wire('model')); 5 | 6 | switch ($maxWidth ?? '2xl') { 7 | case 'sm': 8 | $maxWidth = 'sm:max-w-sm'; 9 | break; 10 | case 'md': 11 | $maxWidth = 'sm:max-w-md'; 12 | break; 13 | case 'lg': 14 | $maxWidth = 'sm:max-w-lg'; 15 | break; 16 | case 'xl': 17 | $maxWidth = 'sm:max-w-xl'; 18 | break; 19 | case '2xl': 20 | default: 21 | $maxWidth = 'sm:max-w-2xl'; 22 | break; 23 | } 24 | @endphp 25 | 26 | 72 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/nav-link.blade.php: -------------------------------------------------------------------------------- 1 | @props(['active']) 2 | 3 | @php 4 | $classes = ($active ?? false) 5 | ? 'inline-flex items-center px-1 pt-1 border-b-2 border-indigo-400 text-sm font-medium leading-5 text-gray-900 focus:outline-none focus:border-indigo-700 transition duration-150 ease-in-out' 6 | : 'inline-flex items-center px-1 pt-1 border-b-2 border-transparent text-sm font-medium leading-5 text-gray-500 hover:text-gray-700 hover:border-gray-300 focus:outline-none focus:text-gray-700 focus:border-gray-300 transition duration-150 ease-in-out'; 7 | @endphp 8 | 9 | merge(['class' => $classes]) }}> 10 | {{ $slot }} 11 | 12 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/responsive-nav-link.blade.php: -------------------------------------------------------------------------------- 1 | @props(['active']) 2 | 3 | @php 4 | $classes = ($active ?? false) 5 | ? 'block pl-3 pr-4 py-2 border-l-4 border-indigo-400 text-base font-medium text-indigo-700 bg-indigo-50 focus:outline-none focus:text-indigo-800 focus:bg-indigo-100 focus:border-indigo-700 transition duration-150 ease-in-out' 6 | : 'block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 hover:border-gray-300 focus:outline-none focus:text-gray-800 focus:bg-gray-50 focus:border-gray-300 transition duration-150 ease-in-out'; 7 | @endphp 8 | 9 | merge(['class' => $classes]) }}> 10 | {{ $slot }} 11 | 12 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/secondary-button.blade.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/section-border.blade.php: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/section-title.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |

{{ $title }}

4 | 5 |

6 | {{ $description }} 7 |

8 |
9 |
10 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/switchable-team.blade.php: -------------------------------------------------------------------------------- 1 | @props(['team', 'component' => 'jet-dropdown-link']) 2 | 3 |
4 | @method('PUT') 5 | @csrf 6 | 7 | 8 | 9 | 10 | 11 |
12 | @if (Auth::user()->isCurrentTeam($team)) 13 | 14 | @endif 15 | 16 |
{{ $team->name }}
17 |
18 |
19 |
20 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/validation-errors.blade.php: -------------------------------------------------------------------------------- 1 | @if ($errors->any()) 2 |
3 |
{{ __('Whoops! Something went wrong.') }}
4 | 5 | 10 |
11 | @endif 12 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 18 | return $request->user(); 19 | }); 20 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->purpose('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'auth:sanctum', 19 | 'verified', 20 | 'accessrole', 21 | ]], function () { 22 | 23 | Route::get('/dashboard', function () { 24 | return view('dashboard'); 25 | })->name('dashboard'); 26 | 27 | Route::get('/pages', function () { 28 | return view('admin.pages'); 29 | })->name('pages'); 30 | 31 | Route::get('/navigation-menus', function () { 32 | return view('admin.navigation-menus'); 33 | })->name('navigation-menus'); 34 | 35 | Route::get('/users', function () { 36 | return view('admin.users'); 37 | })->name('users'); 38 | 39 | Route::get('/user-permissions', function () { 40 | return view('admin.user-permissions'); 41 | })->name('user-permissions'); 42 | 43 | }); 44 | 45 | Route::get('/{urlslug}', Frontpage::class); 46 | Route::get('/', Frontpage::class); 47 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | compiled.php 2 | config.php 3 | down 4 | events.scanned.php 5 | maintenance.php 6 | routes.php 7 | routes.scanned.php 8 | schedule-* 9 | services.json 10 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /stubs/console.stub: -------------------------------------------------------------------------------- 1 | modelId); 41 | // Assign the variables here 42 | } 43 | 44 | /** 45 | * The data for the model mapped 46 | * in this component. 47 | * 48 | * @return void 49 | */ 50 | public function modelData() 51 | { 52 | return [ 53 | ]; 54 | } 55 | 56 | /** 57 | * The create function. 58 | * 59 | * @return void 60 | */ 61 | public function create() 62 | { 63 | $this->validate(); 64 | {{}}::create($this->modelData()); 65 | $this->modalFormVisible = false; 66 | $this->reset(); 67 | } 68 | 69 | /** 70 | * The read function. 71 | * 72 | * @return void 73 | */ 74 | public function read() 75 | { 76 | return {{}}::paginate(5); 77 | } 78 | 79 | /** 80 | * The update function 81 | * 82 | * @return void 83 | */ 84 | public function update() 85 | { 86 | $this->validate(); 87 | {{}}::find($this->modelId)->update($this->modelData()); 88 | $this->modalFormVisible = false; 89 | } 90 | 91 | /** 92 | * The delete function. 93 | * 94 | * @return void 95 | */ 96 | public function delete() 97 | { 98 | {{}}::destroy($this->modelId); 99 | $this->modalConfirmDeleteVisible = false; 100 | $this->resetPage(); 101 | } 102 | 103 | /** 104 | * Shows the create modal 105 | * 106 | * @return void 107 | */ 108 | public function createShowModal() 109 | { 110 | $this->resetValidation(); 111 | $this->reset(); 112 | $this->modalFormVisible = true; 113 | } 114 | 115 | /** 116 | * Shows the form modal 117 | * in update mode. 118 | * 119 | * @param mixed $id 120 | * @return void 121 | */ 122 | public function updateShowModal($id) 123 | { 124 | $this->resetValidation(); 125 | $this->reset(); 126 | $this->modalFormVisible = true; 127 | $this->modelId = $id; 128 | $this->loadModel(); 129 | } 130 | 131 | /** 132 | * Shows the delete confirmation modal. 133 | * 134 | * @param mixed $id 135 | * @return void 136 | */ 137 | public function deleteShowModal($id) 138 | { 139 | $this->modelId = $id; 140 | $this->modalConfirmDeleteVisible = true; 141 | } 142 | 143 | public function render() 144 | { 145 | return view('livewire.{{}}', [ 146 | 'data' => $this->read(), 147 | ]); 148 | } 149 | } -------------------------------------------------------------------------------- /stubs/factory.stub: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->timestamps(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::dropIfExists('{{ table }}'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /stubs/migration.stub: -------------------------------------------------------------------------------- 1 | get('/'); 19 | 20 | $response->assertStatus(200); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /stubs/test.unit.stub: -------------------------------------------------------------------------------- 1 | assertTrue(true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | const defaultTheme = require('tailwindcss/defaultTheme'); 2 | 3 | module.exports = { 4 | purge: [ 5 | './vendor/laravel/jetstream/**/*.blade.php', 6 | './storage/framework/views/*.php', 7 | './resources/views/**/*.blade.php', 8 | ], 9 | 10 | theme: { 11 | extend: { 12 | fontFamily: { 13 | sans: ['Nunito', ...defaultTheme.fontFamily.sans], 14 | }, 15 | }, 16 | }, 17 | 18 | variants: { 19 | opacity: ['responsive', 'hover', 'focus', 'disabled'], 20 | }, 21 | 22 | plugins: [require('@tailwindcss/ui')], 23 | }; 24 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | const mix = require("laravel-mix"); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel applications. By default, we are compiling the CSS 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.js("resources/js/app.js", "public/js") 15 | .postCss("resources/css/app.css", "public/css", [ 16 | require("postcss-import"), 17 | require("tailwindcss") 18 | ]) 19 | .browserSync("http://localhost:8000"); 20 | -------------------------------------------------------------------------------- /websocket/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules -------------------------------------------------------------------------------- /websocket/eventNotificationServer.js: -------------------------------------------------------------------------------- 1 | var WebSocketServer = require("websocket").server; 2 | var http = require("http"); 3 | var htmlEntity = require("html-entities"); 4 | var PORT = 3280; 5 | 6 | // List of currently connected clients (users) 7 | var clients = []; 8 | 9 | // Create http server 10 | var server = http.createServer(); 11 | 12 | server.listen(PORT, function() { 13 | console.log("Server is listening on PORT:" + PORT); 14 | }); 15 | 16 | // Create the websocket server here 17 | wsServer = new WebSocketServer({ 18 | httpServer: server 19 | }); 20 | 21 | /** 22 | * The websocker server 23 | */ 24 | wsServer.on("request", function(request) { 25 | var connection = request.accept(null, request.origin); 26 | 27 | // Pass each connection instance to each client 28 | var index = clients.push(connection) - 1; 29 | console.log("Client", index, "connected"); 30 | 31 | /** 32 | * This is where the send message to all the clients connected 33 | */ 34 | connection.on("message", function(message) { 35 | var utf8Data = JSON.parse(message.utf8Data); 36 | 37 | if (message.type === "utf8") { 38 | //Prepare the json data to be sent to all clients that are connected 39 | var obj = JSON.stringify({ 40 | eventName: htmlEntity.encode(utf8Data.eventName), 41 | eventMessage: htmlEntity.encode(utf8Data.eventMessage) 42 | }); 43 | 44 | // Send them to all the clients 45 | for (let i = 0; i < clients.length; i++) { 46 | clients[i].sendUTF(obj); 47 | } 48 | } 49 | }); 50 | 51 | /** 52 | * When the client closes its connection to the websocket server 53 | */ 54 | connection.on("close", function(connection) { 55 | clients.splice(index, 1); 56 | console.log("Client", index, "was disconnected"); 57 | }); 58 | }); 59 | -------------------------------------------------------------------------------- /websocket/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "websocket_for_our_cms", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "nodemon eventNotificationServer.js", 8 | "eventNotification": "nodemon eventNotificationServer.js", 9 | "chatServer": "nodemon chatServer.js" 10 | }, 11 | "keywords": [], 12 | "author": "", 13 | "license": "ISC", 14 | "dependencies": { 15 | "html-entities": "2.1.0", 16 | "mysql": "2.18.1", 17 | "uniqid": "5.3.0", 18 | "websocket": "1.0.33" 19 | } 20 | } 21 | --------------------------------------------------------------------------------