├── .DS_Store ├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── .idea ├── commandlinetools │ ├── Laravel_09_01_2021__12_11.xml │ └── schemas │ │ └── frameworkDescriptionVersion1.1.4.xsd ├── listings.iml ├── modules.xml ├── php.xml ├── phpunit.xml └── workspace.xml ├── .styleci.yml ├── README.md ├── app ├── Actions │ ├── Fortify │ │ ├── CreateNewUser.php │ │ ├── PasswordValidationRules.php │ │ ├── ResetUserPassword.php │ │ ├── UpdateUserPassword.php │ │ └── UpdateUserProfileInformation.php │ └── Jetstream │ │ └── DeleteUser.php ├── Console │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Controller.php │ │ ├── ListingController.php │ │ ├── MessageController.php │ │ └── RegisterStepTwoController.php │ ├── Kernel.php │ ├── Livewire │ │ ├── ListingSaveButton.php │ │ └── ListingSavedCheckbox.php │ ├── Middleware │ │ ├── Authenticate.php │ │ ├── CheckRegistrationCompletedMiddleware.php │ │ ├── EncryptCookies.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustHosts.php │ │ ├── TrustProxies.php │ │ └── VerifyCsrfToken.php │ └── Requests │ │ └── StoreListingRequest.php ├── Models │ ├── Category.php │ ├── City.php │ ├── Color.php │ ├── Listing.php │ ├── Message.php │ ├── Size.php │ └── User.php ├── Notifications │ └── ListingMessageNotification.php ├── Policies │ └── ListingPolicy.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 ├── logging.php ├── mail.php ├── queue.php ├── sanctum.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ ├── ListingFactory.php │ └── 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 │ ├── 2021_01_09_100539_create_sessions_table.php │ ├── 2021_01_13_064350_create_cities_table.php │ ├── 2021_01_19_095222_add_fields_to_users_table.php │ ├── 2021_01_25_060046_create_listings_table.php │ ├── 2021_01_29_062120_add_user_id_to_listings_table.php │ ├── 2021_01_31_071204_create_media_table.php │ ├── 2021_02_01_055134_create_categories_table.php │ ├── 2021_02_01_055257_create_category_listing_table.php │ ├── 2021_02_01_060549_create_sizes_table.php │ ├── 2021_02_01_060602_create_listing_size_table.php │ ├── 2021_02_01_061059_create_colors_table.php │ ├── 2021_02_01_061108_create_color_listing_table.php │ ├── 2021_02_02_092529_create_listing_user_table.php │ └── 2021_02_02_103821_create_messages_table.php └── seeders │ ├── CategorySeeder.php │ ├── CitiesTableSeeder.php │ ├── ColorSeeder.php │ ├── DatabaseSeeder.php │ ├── ListingSeeder.php │ └── SizeSeeder.php ├── docker-compose.yml ├── package-lock.json ├── package.json ├── phpunit.xml ├── public ├── .DS_Store ├── .htaccess ├── css │ └── app.css ├── favicon.ico ├── index.php ├── js │ ├── app.js │ └── app.js.LICENSE.txt ├── 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 ├── markdown │ ├── policy.md │ └── terms.md └── views │ ├── api │ ├── api-token-manager.blade.php │ └── index.blade.php │ ├── auth │ ├── confirm-password.blade.php │ ├── forgot-password.blade.php │ ├── login.blade.php │ ├── register-step2.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 │ └── guest.blade.php │ ├── listings │ ├── create.blade.php │ ├── edit.blade.php │ └── index.blade.php │ ├── livewire │ ├── listing-save-button.blade.php │ └── listing-saved-checkbox.blade.php │ ├── messages │ └── create.blade.php │ ├── navigation-menu.blade.php │ ├── policy.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 │ ├── terms.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 │ │ ├── banner.blade.php │ │ ├── button.blade.php │ │ ├── checkbox.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 │ │ └── mail │ │ └── team-invitation.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 ├── tailwind.config.js ├── tests ├── CreatesApplication.php ├── Feature │ ├── ApiTokenPermissionsTest.php │ ├── AuthenticationTest.php │ ├── BrowserSessionsTest.php │ ├── CreateApiTokenTest.php │ ├── DeleteAccountTest.php │ ├── DeleteApiTokenTest.php │ ├── EmailVerificationTest.php │ ├── ExampleTest.php │ ├── PasswordConfirmationTest.php │ ├── PasswordResetTest.php │ ├── ProfileInformationTest.php │ ├── RegistrationTest.php │ ├── TwoFactorAuthenticationSettingsTest.php │ └── UpdatePasswordTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php └── webpack.mix.js /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Jetstream-Listings-Course/79592454542ac92e8760c2d8d90bbc365c69c5aa/.DS_Store -------------------------------------------------------------------------------- /.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 | LOG_LEVEL=debug 9 | 10 | DB_CONNECTION=mysql 11 | DB_HOST=127.0.0.1 12 | DB_PORT=3306 13 | DB_DATABASE=listings 14 | DB_USERNAME=root 15 | DB_PASSWORD= 16 | 17 | BROADCAST_DRIVER=log 18 | CACHE_DRIVER=file 19 | QUEUE_CONNECTION=sync 20 | SESSION_DRIVER=database 21 | SESSION_LIFETIME=120 22 | 23 | MEMCACHED_HOST=127.0.0.1 24 | 25 | REDIS_HOST=127.0.0.1 26 | REDIS_PASSWORD=null 27 | REDIS_PORT=6379 28 | 29 | MAIL_MAILER=smtp 30 | MAIL_HOST=mailhog 31 | MAIL_PORT=1025 32 | MAIL_USERNAME=null 33 | MAIL_PASSWORD=null 34 | MAIL_ENCRYPTION=null 35 | MAIL_FROM_ADDRESS=null 36 | MAIL_FROM_NAME="${APP_NAME}" 37 | 38 | AWS_ACCESS_KEY_ID= 39 | AWS_SECRET_ACCESS_KEY= 40 | AWS_DEFAULT_REGION=us-east-1 41 | AWS_BUCKET= 42 | 43 | PUSHER_APP_ID= 44 | PUSHER_APP_KEY= 45 | PUSHER_APP_SECRET= 46 | PUSHER_APP_CLUSTER=mt1 47 | 48 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 49 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 50 | -------------------------------------------------------------------------------- /.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 | docker-compose.override.yml 10 | Homestead.json 11 | Homestead.yaml 12 | npm-debug.log 13 | yarn-error.log 14 | .idea/ 15 | -------------------------------------------------------------------------------- /.idea/commandlinetools/schemas/frameworkDescriptionVersion1.1.4.xsd: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 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 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /.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'], 25 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 26 | 'password' => $this->passwordRules(), 27 | 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['required', 'accepted'] : '', 28 | ])->validate(); 29 | 30 | return User::create([ 31 | 'name' => $input['name'], 32 | 'email' => $input['email'], 33 | 'password' => Hash::make($input['password']), 34 | ]); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /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 (! isset($input['current_password']) || ! 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/DeleteUser.php: -------------------------------------------------------------------------------- 1 | deleteProfilePhoto(); 18 | $user->tokens->each->delete(); 19 | $user->delete(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /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 | reportable(function (Throwable $e) { 37 | // 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | validate(['message' => 'required']); 32 | 33 | $listing = Listing::with('user')->findOrFail($request->listing_id); 34 | 35 | // Save message 36 | $sentMessages = Message::where('user_id', auth()->id()) 37 | ->where('created_at', '>', now()->subMinute()) 38 | ->count(); 39 | if ($sentMessages < 5) { 40 | Message::create([ 41 | 'user_id' => auth()->id(), 42 | 'listing_id' => $request->listing_id, 43 | 'message_text' => $request->message, 44 | ]); 45 | 46 | $message = [ 47 | 'name' => auth()->user()->name, 48 | 'email' => auth()->user()->email, 49 | 'listingTitle' => $listing->title, 50 | 'messageText' => $request->message, 51 | ]; 52 | 53 | Notification::route('mail', $listing->user->email) 54 | ->notify(new ListingMessageNotification($message)); 55 | } 56 | 57 | return redirect()->route('listings.index')->with('message', 'Message sent successfully'); 58 | 59 | // Send message 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/Http/Controllers/RegisterStepTwoController.php: -------------------------------------------------------------------------------- 1 | user()->update([ 20 | 'phone' => $request->phone, 21 | 'address' => $request->address, 22 | 'city_id' => $request->city_id, 23 | ]); 24 | 25 | if ($request->hasFile('photo')) { 26 | auth()->user()->updateProfilePhoto($request->photo); 27 | } 28 | 29 | return redirect()->route('dashboard'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | [ 34 | \App\Http\Middleware\EncryptCookies::class, 35 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 36 | \Illuminate\Session\Middleware\StartSession::class, 37 | \Laravel\Jetstream\Http\Middleware\AuthenticateSession::class, 38 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 39 | \App\Http\Middleware\VerifyCsrfToken::class, 40 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 41 | ], 42 | 43 | 'api' => [ 44 | 'throttle:api', 45 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 46 | ], 47 | ]; 48 | 49 | /** 50 | * The application's route middleware. 51 | * 52 | * These middleware may be assigned to groups or used individually. 53 | * 54 | * @var array 55 | */ 56 | protected $routeMiddleware = [ 57 | 'auth' => \App\Http\Middleware\Authenticate::class, 58 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 59 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 60 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 61 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 62 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 63 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 64 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 65 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 66 | 'registration_completed' => CheckRegistrationCompletedMiddleware::class, 67 | ]; 68 | } 69 | -------------------------------------------------------------------------------- /app/Http/Livewire/ListingSaveButton.php: -------------------------------------------------------------------------------- 1 | user()->savedListings()->get()->contains($this->listingId); 14 | 15 | return view('livewire.listing-save-button', compact('savedListing')); 16 | } 17 | 18 | public function saveListing() 19 | { 20 | auth()->user()->savedListings()->attach($this->listingId); 21 | $this->emit('listingSaved'); 22 | } 23 | 24 | public function unsaveListing() 25 | { 26 | auth()->user()->savedListings()->detach($this->listingId); 27 | $this->emit('listingSaved'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Http/Livewire/ListingSavedCheckbox.php: -------------------------------------------------------------------------------- 1 | 'render' 11 | ]; 12 | 13 | public function render() 14 | { 15 | $savedAmount = auth()->user()->savedListings()->count(); 16 | 17 | return view('livewire.listing-saved-checkbox', compact('savedAmount')); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/CheckRegistrationCompletedMiddleware.php: -------------------------------------------------------------------------------- 1 | user()->phone) 20 | && is_null(auth()->user()->address) 21 | && is_null(auth()->user()->city_id)) { 22 | return redirect()->route('register-step2.create'); 23 | } 24 | 25 | return $next($request); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.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 | 'required', 28 | 'description' => 'required', 29 | 'price' => 'required|numeric' 30 | ]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Models/Category.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 20 | } 21 | 22 | public function savedUsers() 23 | { 24 | return $this->belongsToMany(User::class); 25 | } 26 | 27 | public function registerMediaConversions(Media $media = null): void 28 | { 29 | $this->addMediaConversion('thumb') 30 | ->width(200) 31 | ->height(200); 32 | } 33 | 34 | public function categories() 35 | { 36 | return $this->belongsToMany(Category::class); 37 | } 38 | 39 | public function sizes() 40 | { 41 | return $this->belongsToMany(Size::class); 42 | } 43 | 44 | public function colors() 45 | { 46 | return $this->belongsToMany(Color::class); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/Models/Message.php: -------------------------------------------------------------------------------- 1 | 'datetime', 54 | ]; 55 | 56 | /** 57 | * The accessors to append to the model's array form. 58 | * 59 | * @var array 60 | */ 61 | protected $appends = [ 62 | 'profile_photo_url', 63 | ]; 64 | 65 | public function listings() 66 | { 67 | return $this->hasMany(Listing::class); 68 | } 69 | 70 | public function city() 71 | { 72 | return $this->belongsTo(City::class); 73 | } 74 | 75 | public function savedListings() 76 | { 77 | return $this->belongsToMany(Listing::class); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/Notifications/ListingMessageNotification.php: -------------------------------------------------------------------------------- 1 | name = $message['name']; 27 | $this->email = $message['email']; 28 | $this->listingTitle = $message['listingTitle']; 29 | $this->messageText = $message['messageText']; 30 | } 31 | 32 | /** 33 | * Get the notification's delivery channels. 34 | * 35 | * @param mixed $notifiable 36 | * @return array 37 | */ 38 | public function via($notifiable) 39 | { 40 | return ['mail']; 41 | } 42 | 43 | /** 44 | * Get the mail representation of the notification. 45 | * 46 | * @param mixed $notifiable 47 | * @return \Illuminate\Notifications\Messages\MailMessage 48 | */ 49 | public function toMail($notifiable) 50 | { 51 | return (new MailMessage) 52 | ->line($this->name . ' ('.$this->email.') has sent you a message about ' . $this->listingTitle) 53 | ->line($this->messageText) 54 | ->line('Thank you for using our application!'); 55 | } 56 | 57 | /** 58 | * Get the array representation of the notification. 59 | * 60 | * @param mixed $notifiable 61 | * @return array 62 | */ 63 | public function toArray($notifiable) 64 | { 65 | return [ 66 | // 67 | ]; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/Policies/ListingPolicy.php: -------------------------------------------------------------------------------- 1 | id == $listing->user_id; 57 | } 58 | 59 | /** 60 | * Determine whether the user can delete the model. 61 | * 62 | * @param \App\Models\User $user 63 | * @param \App\Models\Listing $listing 64 | * @return mixed 65 | */ 66 | public function delete(User $user, Listing $listing) 67 | { 68 | return $user->id == $listing->user_id; 69 | } 70 | 71 | /** 72 | * Determine whether the user can restore the model. 73 | * 74 | * @param \App\Models\User $user 75 | * @param \App\Models\Listing $listing 76 | * @return mixed 77 | */ 78 | public function restore(User $user, Listing $listing) 79 | { 80 | // 81 | } 82 | 83 | /** 84 | * Determine whether the user can permanently delete the model. 85 | * 86 | * @param \App\Models\User $user 87 | * @param \App\Models\Listing $listing 88 | * @return mixed 89 | */ 90 | public function forceDelete(User $user, Listing $listing) 91 | { 92 | // 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /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 | by($request->email.$request->ip()); 41 | }); 42 | 43 | RateLimiter::for('two-factor', function (Request $request) { 44 | return Limit::perMinute(5)->by($request->session()->get('login.id')); 45 | }); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/Providers/JetstreamServiceProvider.php: -------------------------------------------------------------------------------- 1 | configurePermissions(); 29 | 30 | Jetstream::deleteUsersUsing(DeleteUser::class); 31 | } 32 | 33 | /** 34 | * Configure the permissions that are available within the application. 35 | * 36 | * @return void 37 | */ 38 | protected function configurePermissions() 39 | { 40 | Jetstream::defaultApiTokenPermissions(['read']); 41 | 42 | Jetstream::permissions([ 43 | 'create', 44 | 'read', 45 | 'update', 46 | 'delete', 47 | ]); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /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)->by(optional($request->user())->id ?: $request->ip()); 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|^8.0", 12 | "fideloper/proxy": "^4.4", 13 | "fruitcake/laravel-cors": "^2.0", 14 | "guzzlehttp/guzzle": "^7.0.1", 15 | "laravel/framework": "^8.12", 16 | "laravel/jetstream": "^2.0", 17 | "laravel/sanctum": "^2.6", 18 | "laravel/tinker": "^2.5", 19 | "livewire/livewire": "^2.0", 20 | "spatie/laravel-medialibrary": "^9.0.0" 21 | }, 22 | "require-dev": { 23 | "facade/ignition": "^2.5", 24 | "fakerphp/faker": "^1.9.1", 25 | "laravel/sail": "^1.0.1", 26 | "mockery/mockery": "^1.4.2", 27 | "nunomaduro/collision": "^5.0", 28 | "phpunit/phpunit": "^9.3.3" 29 | }, 30 | "config": { 31 | "optimize-autoloader": true, 32 | "preferred-install": "dist", 33 | "sort-packages": true 34 | }, 35 | "extra": { 36 | "laravel": { 37 | "dont-discover": [] 38 | } 39 | }, 40 | "autoload": { 41 | "psr-4": { 42 | "App\\": "app/", 43 | "Database\\Factories\\": "database/factories/", 44 | "Database\\Seeders\\": "database/seeders/" 45 | } 46 | }, 47 | "autoload-dev": { 48 | "psr-4": { 49 | "Tests\\": "tests/" 50 | } 51 | }, 52 | "minimum-stability": "dev", 53 | "prefer-stable": true, 54 | "scripts": { 55 | "post-autoload-dump": [ 56 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 57 | "@php artisan package:discover --ansi" 58 | ], 59 | "post-root-package-install": [ 60 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 61 | ], 62 | "post-create-project-cmd": [ 63 | "@php artisan key:generate --ansi" 64 | ] 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /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 | 'ably' => [ 45 | 'driver' => 'ably', 46 | 'key' => env('ABLY_KEY'), 47 | ], 48 | 49 | 'redis' => [ 50 | 'driver' => 'redis', 51 | 'connection' => 'default', 52 | ], 53 | 54 | 'log' => [ 55 | 'driver' => 'log', 56 | ], 57 | 58 | 'null' => [ 59 | 'driver' => 'null', 60 | ], 61 | 62 | ], 63 | 64 | ]; 65 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | | Supported drivers: "apc", "array", "database", "file", 30 | | "memcached", "redis", "dynamodb", "null" 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 | 'lock_connection' => null, 50 | ], 51 | 52 | 'file' => [ 53 | 'driver' => 'file', 54 | 'path' => storage_path('framework/cache/data'), 55 | ], 56 | 57 | 'memcached' => [ 58 | 'driver' => 'memcached', 59 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 60 | 'sasl' => [ 61 | env('MEMCACHED_USERNAME'), 62 | env('MEMCACHED_PASSWORD'), 63 | ], 64 | 'options' => [ 65 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 66 | ], 67 | 'servers' => [ 68 | [ 69 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 70 | 'port' => env('MEMCACHED_PORT', 11211), 71 | 'weight' => 100, 72 | ], 73 | ], 74 | ], 75 | 76 | 'redis' => [ 77 | 'driver' => 'redis', 78 | 'connection' => 'cache', 79 | 'lock_connection' => 'default', 80 | ], 81 | 82 | 'dynamodb' => [ 83 | 'driver' => 'dynamodb', 84 | 'key' => env('AWS_ACCESS_KEY_ID'), 85 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 86 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 87 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 88 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 89 | ], 90 | 91 | ], 92 | 93 | /* 94 | |-------------------------------------------------------------------------- 95 | | Cache Key Prefix 96 | |-------------------------------------------------------------------------- 97 | | 98 | | When utilizing a RAM based store such as APC or Memcached, there might 99 | | be other applications utilizing the same cache. So, we'll specify a 100 | | value to get prefixed to all our keys so we can avoid collisions. 101 | | 102 | */ 103 | 104 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), 105 | 106 | ]; 107 | -------------------------------------------------------------------------------- /config/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*', 'sanctum/csrf-cookie'], 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 | | Filesystem Disks 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure as many filesystem "disks" as you wish, and you 24 | | may even configure multiple disks of the same driver. Defaults have 25 | | been setup for each driver as an example of the required options. 26 | | 27 | | Supported Drivers: "local", "ftp", "sftp", "s3" 28 | | 29 | */ 30 | 31 | 'disks' => [ 32 | 33 | 'local' => [ 34 | 'driver' => 'local', 35 | 'root' => storage_path('app'), 36 | ], 37 | 38 | 'public' => [ 39 | 'driver' => 'local', 40 | 'root' => storage_path('app/public'), 41 | 'url' => env('APP_URL').'/storage', 42 | 'visibility' => 'public', 43 | ], 44 | 45 | 's3' => [ 46 | 'driver' => 's3', 47 | 'key' => env('AWS_ACCESS_KEY_ID'), 48 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 49 | 'region' => env('AWS_DEFAULT_REGION'), 50 | 'bucket' => env('AWS_BUCKET'), 51 | 'url' => env('AWS_URL'), 52 | 'endpoint' => env('AWS_ENDPOINT'), 53 | ], 54 | 55 | ], 56 | 57 | /* 58 | |-------------------------------------------------------------------------- 59 | | Symbolic Links 60 | |-------------------------------------------------------------------------- 61 | | 62 | | Here you may configure the symbolic links that will be created when the 63 | | `storage:link` Artisan command is executed. The array keys should be 64 | | the locations of the links and the values should be their targets. 65 | | 66 | */ 67 | 68 | 'links' => [ 69 | public_path('storage') => storage_path('app/public'), 70 | ], 71 | 72 | ]; 73 | -------------------------------------------------------------------------------- /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 | | Jetstream Route Middleware 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify which middleware Jetstream will assign to the routes 26 | | that it registers with the application. When necessary, you may modify 27 | | these middleware; however, this default value is usually sufficient. 28 | | 29 | */ 30 | 31 | 'middleware' => ['web'], 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Features 36 | |-------------------------------------------------------------------------- 37 | | 38 | | Some of Jetstream's features are optional. You may disable the features 39 | | by removing them from this array. You're free to only remove some of 40 | | these features or you can even remove all of these if you need to. 41 | | 42 | */ 43 | 44 | 'features' => [ 45 | // Features::termsAndPrivacyPolicy(), 46 | Features::profilePhotos(), 47 | // Features::api(), 48 | // Features::teams(['invitations' => true]), 49 | Features::accountDeletion(), 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /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/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_MAILER', 'smtp'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Mailer Configurations 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure all of the mailers used by your application plus 24 | | their respective settings. Several examples have been configured for 25 | | you and you are free to add your own as your application requires. 26 | | 27 | | Laravel supports a variety of mail "transport" drivers to be used while 28 | | sending an e-mail. You will specify which one you are using for your 29 | | mailers below. You are free to add additional mailers as required. 30 | | 31 | | Supported: "smtp", "sendmail", "mailgun", "ses", 32 | | "postmark", "log", "array" 33 | | 34 | */ 35 | 36 | 'mailers' => [ 37 | 'smtp' => [ 38 | 'transport' => 'smtp', 39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 40 | 'port' => env('MAIL_PORT', 587), 41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 42 | 'username' => env('MAIL_USERNAME'), 43 | 'password' => env('MAIL_PASSWORD'), 44 | 'timeout' => null, 45 | 'auth_mode' => null, 46 | ], 47 | 48 | 'ses' => [ 49 | 'transport' => 'ses', 50 | ], 51 | 52 | 'mailgun' => [ 53 | 'transport' => 'mailgun', 54 | ], 55 | 56 | 'postmark' => [ 57 | 'transport' => 'postmark', 58 | ], 59 | 60 | 'sendmail' => [ 61 | 'transport' => 'sendmail', 62 | 'path' => '/usr/sbin/sendmail -bs', 63 | ], 64 | 65 | 'log' => [ 66 | 'transport' => 'log', 67 | 'channel' => env('MAIL_LOG_CHANNEL'), 68 | ], 69 | 70 | 'array' => [ 71 | 'transport' => 'array', 72 | ], 73 | ], 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Global "From" Address 78 | |-------------------------------------------------------------------------- 79 | | 80 | | You may wish for all e-mails sent by your application to be sent from 81 | | the same address. Here, you may specify a name and address that is 82 | | used globally for all e-mails that are sent by your application. 83 | | 84 | */ 85 | 86 | 'from' => [ 87 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 88 | 'name' => env('MAIL_FROM_NAME', 'Example'), 89 | ], 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Markdown Mail Settings 94 | |-------------------------------------------------------------------------- 95 | | 96 | | If you are using Markdown based email rendering, you may configure your 97 | | theme and component paths here, allowing you to customize the design 98 | | of the emails. Or, you may simply stick with the Laravel defaults! 99 | | 100 | */ 101 | 102 | 'markdown' => [ 103 | 'theme' => 'default', 104 | 105 | 'paths' => [ 106 | resource_path('views/vendor/mail'), 107 | ], 108 | ], 109 | 110 | ]; 111 | -------------------------------------------------------------------------------- /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( 17 | 'SANCTUM_STATEFUL_DOMAINS', 18 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1' 19 | )), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Expiration Minutes 24 | |-------------------------------------------------------------------------- 25 | | 26 | | This value controls the number of minutes until an issued token will be 27 | | considered expired. If this value is null, personal access tokens do 28 | | not expire. This won't tweak the lifetime of first-party sessions. 29 | | 30 | */ 31 | 32 | 'expiration' => null, 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | Sanctum Middleware 37 | |-------------------------------------------------------------------------- 38 | | 39 | | When authenticating your first-party SPA with Sanctum you may need to 40 | | customize some of the middleware Sanctum uses while processing the 41 | | request. You may change the middleware listed below as required. 42 | | 43 | */ 44 | 45 | 'middleware' => [ 46 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, 47 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, 48 | ], 49 | 50 | ]; 51 | -------------------------------------------------------------------------------- /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/ListingFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->text(20), 26 | 'description' => $this->faker->text(200), 27 | 'price' => rand(10, 999) 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /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/2021_01_09_100539_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/2021_01_13_064350_create_cities_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('cities'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2021_01_19_095222_add_fields_to_users_table.php: -------------------------------------------------------------------------------- 1 | string('phone')->nullable(); 18 | $table->string('address')->nullable(); 19 | $table->foreignId('city_id')->nullable()->constrained(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::table('users', function (Blueprint $table) { 31 | // 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2021_01_25_060046_create_listings_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('title'); 19 | $table->text('description'); 20 | $table->decimal('price'); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('listings'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2021_01_29_062120_add_user_id_to_listings_table.php: -------------------------------------------------------------------------------- 1 | foreignId('user_id')->nullable()->constrained(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('listings', function (Blueprint $table) { 29 | // 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2021_01_31_071204_create_media_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 13 | 14 | $table->morphs('model'); 15 | $table->uuid('uuid')->nullable()->unique(); 16 | $table->string('collection_name'); 17 | $table->string('name'); 18 | $table->string('file_name'); 19 | $table->string('mime_type')->nullable(); 20 | $table->string('disk'); 21 | $table->string('conversions_disk')->nullable(); 22 | $table->unsignedBigInteger('size'); 23 | $table->json('manipulations'); 24 | $table->json('custom_properties'); 25 | $table->json('generated_conversions'); 26 | $table->json('responsive_images'); 27 | $table->unsignedInteger('order_column')->nullable(); 28 | 29 | $table->nullableTimestamps(); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2021_02_01_055134_create_categories_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('categories'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2021_02_01_055257_create_category_listing_table.php: -------------------------------------------------------------------------------- 1 | foreignId('category_id')->constrained(); 18 | $table->foreignId('listing_id')->constrained(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::dropIfExists('category_listing'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/migrations/2021_02_01_060549_create_sizes_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('sizes'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2021_02_01_060602_create_listing_size_table.php: -------------------------------------------------------------------------------- 1 | foreignId('listing_id')->constrained(); 18 | $table->foreignId('size_id')->constrained(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::dropIfExists('listing_size'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/migrations/2021_02_01_061059_create_colors_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('colors'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2021_02_01_061108_create_color_listing_table.php: -------------------------------------------------------------------------------- 1 | foreignId('color_id')->constrained(); 18 | $table->foreignId('listing_id')->constrained(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::dropIfExists('color_listing'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/migrations/2021_02_02_092529_create_listing_user_table.php: -------------------------------------------------------------------------------- 1 | foreignId('listing_id')->constrained(); 18 | $table->foreignId('user_id')->constrained(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::dropIfExists('listing_user'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/migrations/2021_02_02_103821_create_messages_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignId('user_id')->constrained(); 19 | $table->foreignId('listing_id')->constrained(); 20 | $table->text('message_text'); 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/CategorySeeder.php: -------------------------------------------------------------------------------- 1 | 'Toys']); 18 | Category::create(['name' => 'Gadgets']); 19 | Category::create(['name' => 'Food']); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /database/seeders/ColorSeeder.php: -------------------------------------------------------------------------------- 1 | 'Red']); 18 | Color::create(['name' => 'Yellow']); 19 | Color::create(['name' => 'Blue']); 20 | Color::create(['name' => 'Black']); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(CitiesTableSeeder::class); 17 | $this->call(CategorySeeder::class); 18 | $this->call(SizeSeeder::class); 19 | $this->call(ColorSeeder::class); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /database/seeders/ListingSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /database/seeders/SizeSeeder.php: -------------------------------------------------------------------------------- 1 | 'XXS']); 18 | Size::create(['name' => 'XS']); 19 | Size::create(['name' => 'S']); 20 | Size::create(['name' => 'M']); 21 | Size::create(['name' => 'L']); 22 | Size::create(['name' => 'XL']); 23 | Size::create(['name' => 'XXL']); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | # For more information: https://laravel.com/docs/sail 2 | version: '3' 3 | services: 4 | laravel.test: 5 | build: 6 | context: ./vendor/laravel/sail/runtimes/8.0 7 | dockerfile: Dockerfile 8 | args: 9 | WWWGROUP: '${WWWGROUP}' 10 | image: sail-8.0/app 11 | ports: 12 | - '${APP_PORT:-80}:80' 13 | environment: 14 | WWWUSER: '${WWWUSER}' 15 | LARAVEL_SAIL: 1 16 | volumes: 17 | - '.:/var/www/html' 18 | networks: 19 | - sail 20 | depends_on: 21 | - mysql 22 | - redis 23 | # - selenium 24 | # selenium: 25 | # image: 'selenium/standalone-chrome' 26 | # volumes: 27 | # - '/dev/shm:/dev/shm' 28 | # networks: 29 | # - sail 30 | # depends_on: 31 | # - laravel.test 32 | mysql: 33 | image: 'mysql:8.0' 34 | ports: 35 | - '${FORWARD_DB_PORT:-3306}:3306' 36 | environment: 37 | MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' 38 | MYSQL_DATABASE: '${DB_DATABASE}' 39 | MYSQL_USER: '${DB_USERNAME}' 40 | MYSQL_PASSWORD: '${DB_PASSWORD}' 41 | MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' 42 | volumes: 43 | - 'sailmysql:/var/lib/mysql' 44 | networks: 45 | - sail 46 | redis: 47 | image: 'redis:alpine' 48 | ports: 49 | - '${FORWARD_REDIS_PORT:-6379}:6379' 50 | volumes: 51 | - 'sailredis:/data' 52 | networks: 53 | - sail 54 | # memcached: 55 | # image: 'memcached:alpine' 56 | # ports: 57 | # - '11211:11211' 58 | # networks: 59 | # - sail 60 | mailhog: 61 | image: 'mailhog/mailhog:latest' 62 | ports: 63 | - 1025:1025 64 | - 8025:8025 65 | networks: 66 | - sail 67 | networks: 68 | sail: 69 | driver: bridge 70 | volumes: 71 | sailmysql: 72 | driver: local 73 | sailredis: 74 | driver: local 75 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "mix", 6 | "watch": "mix watch", 7 | "watch-poll": "mix watch -- --watch-options-poll=1000", 8 | "hot": "mix watch --hot", 9 | "prod": "npm run production", 10 | "production": "mix --production" 11 | }, 12 | "devDependencies": { 13 | "@tailwindcss/forms": "^0.2.1", 14 | "@tailwindcss/typography": "^0.3.0", 15 | "alpinejs": "^2.7.3", 16 | "autoprefixer": "^10.0.2", 17 | "axios": "^0.21", 18 | "laravel-mix": "^6.0.6", 19 | "lodash": "^4.17.19", 20 | "postcss": "^8.1.14", 21 | "postcss-import": "^12.0.1", 22 | "tailwindcss": "^2.0.1" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /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/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Jetstream-Listings-Course/79592454542ac92e8760c2d8d90bbc365c69c5aa/public/.DS_Store -------------------------------------------------------------------------------- /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/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Jetstream-Listings-Course/79592454542ac92e8760c2d8d90bbc365c69c5aa/public/favicon.ico -------------------------------------------------------------------------------- /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/app.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Lodash 4 | * Copyright OpenJS Foundation and other contributors 5 | * Released under MIT license 6 | * Based on Underscore.js 1.8.3 7 | * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 8 | */ 9 | -------------------------------------------------------------------------------- /public/mix-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "/js/app.js": "/js/app.js?id=d5cc273f2db519e7507f", 3 | "/css/app.css": "/css/app.css?id=7b52878b17a2584ec489" 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 | -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | require('./bootstrap'); 2 | 3 | require('alpinejs'); 4 | -------------------------------------------------------------------------------- /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 | 'password' => 'The provided password is incorrect.', 18 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 19 | 20 | ]; 21 | -------------------------------------------------------------------------------- /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/markdown/policy.md: -------------------------------------------------------------------------------- 1 | # Privacy Policy 2 | 3 | Edit this file to define the privacy policy for your application. 4 | -------------------------------------------------------------------------------- /resources/markdown/terms.md: -------------------------------------------------------------------------------- 1 | # Terms of Service 2 | 3 | Edit this file to define the terms of service for your application. 4 | -------------------------------------------------------------------------------- /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/confirm-password.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | This is a secure area of the application. Please confirm your password before continuing. 9 |
10 | 11 | 12 | 13 |
14 | @csrf 15 | 16 |
17 | 18 | 19 |
20 | 21 |
22 | 23 | {{ __('Confirm') }} 24 | 25 |
26 |
27 |
28 |
29 | -------------------------------------------------------------------------------- /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-step2.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 | 29 |
30 | 31 |
32 | 33 | 34 |
35 | 36 |
37 | 38 | {{ __('Finish Registration') }} 39 | 40 |
41 |
42 |
43 |
44 | -------------------------------------------------------------------------------- /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 | @if (Laravel\Jetstream\Jetstream::hasTermsAndPrivacyPolicyFeature()) 33 |
34 | 35 |
36 | 37 | 38 |
39 | {!! __('I agree to the :terms_of_service and :privacy_policy', [ 40 | 'terms_of_service' => ''.__('Terms of Service').'', 41 | 'privacy_policy' => ''.__('Privacy Policy').'', 42 | ]) !!} 43 |
44 |
45 |
46 |
47 | @endif 48 | 49 |
50 | 51 | {{ __('Already registered?') }} 52 | 53 | 54 | 55 | {{ __('Register') }} 56 | 57 |
58 |
59 |
60 |
61 | -------------------------------------------------------------------------------- /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/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ config('app.name', 'Laravel') }} 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | @livewireStyles 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | @livewire('navigation-menu') 26 | 27 | 28 |
29 |
30 | {{ $header }} 31 |
32 |
33 | 34 | 35 |
36 | {{ $slot }} 37 |
38 |
39 | 40 | @stack('modals') 41 | 42 | @livewireScripts 43 | 44 | 45 | -------------------------------------------------------------------------------- /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/listings/create.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('Add new listing') }} 5 |

6 |
7 | 8 |
9 |
10 | 11 | 12 |
13 | @csrf 14 | 15 |
16 | 17 | 18 |
19 | 20 |
21 | 22 | 23 |
24 | 25 |
26 | 27 | 28 |
29 | 30 |
31 | 32 | 33 |
34 | 35 |
36 | 37 | 38 |
39 | 40 |
41 | 42 | 43 |
44 | 45 |
46 | 47 | @foreach($categories as $category) 48 | 49 | {{ $category->name }} 50 |
51 | @endforeach 52 |
53 | 54 |
55 | 56 | @foreach($sizes as $size) 57 | 58 | {{ $size->name }} 59 |
60 | @endforeach 61 |
62 | 63 |
64 | 65 | @foreach($colors as $color) 66 | 67 | {{ $color->name }} 68 |
69 | @endforeach 70 |
71 | 72 |
73 | 74 | {{ __('Save listing') }} 75 | 76 |
77 |
78 |
79 |
80 |
81 | -------------------------------------------------------------------------------- /resources/views/livewire/listing-save-button.blade.php: -------------------------------------------------------------------------------- 1 | 2 | @if ($savedListing) 3 | Unsave 5 | @else 6 | Save 8 | @endif 9 | 10 | -------------------------------------------------------------------------------- /resources/views/livewire/listing-saved-checkbox.blade.php: -------------------------------------------------------------------------------- 1 | 2 | Saved ({{ $savedAmount }}) 3 | 4 | -------------------------------------------------------------------------------- /resources/views/messages/create.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | {{ __('Send a Message') }} 5 |

6 |
7 | 8 |
9 |
10 |
11 | 12 | @csrf 13 | 14 |
15 | 16 | 17 |
18 | 19 |
20 | 21 | {{ __('Send message') }} 22 | 23 |
24 |
25 |
26 |
27 |
28 | -------------------------------------------------------------------------------- /resources/views/policy.blade.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 | 6 |
7 | 8 |
9 | {!! $policy !!} 10 |
11 |
12 |
13 |
14 | -------------------------------------------------------------------------------- /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 | 36 | 37 | 38 |
39 |
40 | 41 | 42 | 43 | {{ __('Nevermind') }} 44 | 45 | 46 | 47 | {{ __('Delete Account') }} 48 | 49 | 50 |
51 |
52 |
53 | -------------------------------------------------------------------------------- /resources/views/profile/show.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

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

6 |
7 | 8 |
9 |
10 | @if (Laravel\Fortify\Features::canUpdateProfileInformation()) 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 | @if (Laravel\Jetstream\Jetstream::hasAccountDeletionFeatures()) 37 | 38 |
39 | @livewire('profile.delete-user-form') 40 |
41 | @endif 42 |
43 |
44 |
45 | -------------------------------------------------------------------------------- /resources/views/profile/two-factor-authentication-form.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ __('Two Factor Authentication') }} 4 | 5 | 6 | 7 | {{ __('Add additional security to your account using two factor authentication.') }} 8 | 9 | 10 | 11 |

12 | @if ($this->enabled) 13 | {{ __('You have enabled two factor authentication.') }} 14 | @else 15 | {{ __('You have not enabled two factor authentication.') }} 16 | @endif 17 |

18 | 19 |
20 |

21 | {{ __('When two factor authentication is enabled, you will be prompted for a secure, random token during authentication. You may retrieve this token from your phone\'s Google Authenticator application.') }} 22 |

23 |
24 | 25 | @if ($this->enabled) 26 | @if ($showingQrCode) 27 |
28 |

29 | {{ __('Two factor authentication is now enabled. Scan the following QR code using your phone\'s authenticator application.') }} 30 |

31 |
32 | 33 |
34 | {!! $this->user->twoFactorQrCodeSvg() !!} 35 |
36 | @endif 37 | 38 | @if ($showingRecoveryCodes) 39 |
40 |

41 | {{ __('Store these recovery codes in a secure password manager. They can be used to recover access to your account if your two factor authentication device is lost.') }} 42 |

43 |
44 | 45 |
46 | @foreach (json_decode(decrypt($this->user->two_factor_recovery_codes), true) as $code) 47 |
{{ $code }}
48 | @endforeach 49 |
50 | @endif 51 | @endif 52 | 53 |
54 | @if (! $this->enabled) 55 | 56 | 57 | {{ __('Enable') }} 58 | 59 | 60 | @else 61 | @if ($showingRecoveryCodes) 62 | 63 | 64 | {{ __('Regenerate Recovery Codes') }} 65 | 66 | 67 | @else 68 | 69 | 70 | {{ __('Show Recovery Codes') }} 71 | 72 | 73 | @endif 74 | 75 | 76 | 77 | {{ __('Disable') }} 78 | 79 | 80 | @endif 81 |
82 |
83 |
84 | -------------------------------------------------------------------------------- /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/terms.blade.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 | 6 |
7 | 8 |
9 | {!! $terms !!} 10 |
11 |
12 |
13 |
14 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/action-message.blade.php: -------------------------------------------------------------------------------- 1 | @props(['on']) 2 | 3 |
merge(['class' => 'text-sm text-gray-600']) }}> 8 | {{ $slot->isEmpty() ? 'Saved.' : $slot }} 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/banner.blade.php: -------------------------------------------------------------------------------- 1 | @props(['style' => session('flash.bannerStyle', 'success'), 'message' => session('flash.banner')]) 2 | 3 |
13 |
14 |
15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |

23 |
24 | 25 |
26 | 36 |
37 |
38 |
39 |
40 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/button.blade.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/components/checkbox.blade.php: -------------------------------------------------------------------------------- 1 | merge(['class' => 'rounded border-gray-300 text-indigo-600 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50']) !!}> 2 | -------------------------------------------------------------------------------- /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' => 'border-gray-300 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 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 | $maxWidth = [ 7 | 'sm' => 'sm:max-w-sm', 8 | 'md' => 'sm:max-w-md', 9 | 'lg' => 'sm:max-w-lg', 10 | 'xl' => 'sm:max-w-xl', 11 | '2xl' => 'sm:max-w-2xl', 12 | ][$maxWidth ?? '2xl']; 13 | @endphp 14 | 15 | 68 | -------------------------------------------------------------------------------- /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 |
    6 | @foreach ($errors->all() as $error) 7 |
  • {{ $error }}
  • 8 | @endforeach 9 |
10 |
11 | @endif 12 | -------------------------------------------------------------------------------- /resources/views/vendor/jetstream/mail/team-invitation.blade.php: -------------------------------------------------------------------------------- 1 | @component('mail::message') 2 | {{ __('You have been invited to join the :team team!', ['team' => $invitation->team->name]) }} 3 | 4 | {{ __('If you do not have an account, you may create one by clicking the button below. After creating an account, you may click the invitation acceptance button in this email to accept the team invitation:') }} 5 | 6 | @component('mail::button', ['url' => route('register')]) 7 | {{ __('Create Account') }} 8 | @endcomponent 9 | 10 | {{ __('If you already have an account, you may accept this invitation by clicking the button below:') }} 11 | 12 | @component('mail::button', ['url' => $acceptUrl]) 13 | {{ __('Accept Invitation') }} 14 | @endcomponent 15 | 16 | {{ __('If you did not expect to receive an invitation to this team, you may discard this email.') }} 17 | @endcomponent 18 | -------------------------------------------------------------------------------- /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 | ['auth', 'verified']], function () { 22 | Route::group(['middleware' => ['registration_completed']], function () { 23 | Route::get('/dashboard', function () { 24 | return view('dashboard'); 25 | })->name('dashboard'); 26 | }); 27 | 28 | Route::get('register-step2', 29 | [\App\Http\Controllers\RegisterStepTwoController::class, 'create']) 30 | ->name('register-step2.create');; 31 | Route::post('register-step2', 32 | [\App\Http\Controllers\RegisterStepTwoController::class, 'store']) 33 | ->name('register-step2.post'); 34 | 35 | Route::get('listings/{listingId}/photos/{photoId}/delete', [ 36 | \App\Http\Controllers\ListingController::class, 37 | 'deletePhoto' 38 | ])->name('listings.deletePhoto'); 39 | Route::resource('listings', \App\Http\Controllers\ListingController::class); 40 | 41 | Route::resource('messages', \App\Http\Controllers\MessageController::class) 42 | ->only(['create', 'store']); 43 | }); 44 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | extend: { 20 | opacity: ['disabled'], 21 | }, 22 | }, 23 | 24 | plugins: [require('@tailwindcss/forms'), require('@tailwindcss/typography')], 25 | }; 26 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Feature/ApiTokenPermissionsTest.php: -------------------------------------------------------------------------------- 1 | markTestSkipped('API support is not enabled.'); 21 | } 22 | 23 | $this->actingAs($user = User::factory()->withPersonalTeam()->create()); 24 | 25 | $token = $user->tokens()->create([ 26 | 'name' => 'Test Token', 27 | 'token' => Str::random(40), 28 | 'abilities' => ['create', 'read'], 29 | ]); 30 | 31 | Livewire::test(ApiTokenManager::class) 32 | ->set(['managingPermissionsFor' => $token]) 33 | ->set(['updateApiTokenForm' => [ 34 | 'permissions' => [ 35 | 'delete', 36 | 'missing-permission', 37 | ], 38 | ]]) 39 | ->call('updateApiToken'); 40 | 41 | $this->assertTrue($user->fresh()->tokens->first()->can('delete')); 42 | $this->assertFalse($user->fresh()->tokens->first()->can('read')); 43 | $this->assertFalse($user->fresh()->tokens->first()->can('missing-permission')); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /tests/Feature/AuthenticationTest.php: -------------------------------------------------------------------------------- 1 | get('/login'); 17 | 18 | $response->assertStatus(200); 19 | } 20 | 21 | public function test_users_can_authenticate_using_the_login_screen() 22 | { 23 | $user = User::factory()->create(); 24 | 25 | $response = $this->post('/login', [ 26 | 'email' => $user->email, 27 | 'password' => 'password', 28 | ]); 29 | 30 | $this->assertAuthenticated(); 31 | $response->assertRedirect(RouteServiceProvider::HOME); 32 | } 33 | 34 | public function test_users_can_not_authenticate_with_invalid_password() 35 | { 36 | $user = User::factory()->create(); 37 | 38 | $this->post('/login', [ 39 | 'email' => $user->email, 40 | 'password' => 'wrong-password', 41 | ]); 42 | 43 | $this->assertGuest(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /tests/Feature/BrowserSessionsTest.php: -------------------------------------------------------------------------------- 1 | actingAs($user = User::factory()->create()); 18 | 19 | Livewire::test(LogoutOtherBrowserSessionsForm::class) 20 | ->set('password', 'password') 21 | ->call('logoutOtherBrowserSessions'); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/Feature/CreateApiTokenTest.php: -------------------------------------------------------------------------------- 1 | markTestSkipped('API support is not enabled.'); 20 | } 21 | 22 | $this->actingAs($user = User::factory()->withPersonalTeam()->create()); 23 | 24 | Livewire::test(ApiTokenManager::class) 25 | ->set(['createApiTokenForm' => [ 26 | 'name' => 'Test Token', 27 | 'permissions' => [ 28 | 'read', 29 | 'update', 30 | ], 31 | ]]) 32 | ->call('createApiToken'); 33 | 34 | $this->assertCount(1, $user->fresh()->tokens); 35 | $this->assertEquals('Test Token', $user->fresh()->tokens->first()->name); 36 | $this->assertTrue($user->fresh()->tokens->first()->can('read')); 37 | $this->assertFalse($user->fresh()->tokens->first()->can('delete')); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/Feature/DeleteAccountTest.php: -------------------------------------------------------------------------------- 1 | actingAs($user = User::factory()->create()); 18 | 19 | $component = Livewire::test(DeleteUserForm::class) 20 | ->set('password', 'password') 21 | ->call('deleteUser'); 22 | 23 | $this->assertNull($user->fresh()); 24 | } 25 | 26 | public function test_correct_password_must_be_provided_before_account_can_be_deleted() 27 | { 28 | $this->actingAs($user = User::factory()->create()); 29 | 30 | Livewire::test(DeleteUserForm::class) 31 | ->set('password', 'wrong-password') 32 | ->call('deleteUser') 33 | ->assertHasErrors(['password']); 34 | 35 | $this->assertNotNull($user->fresh()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/Feature/DeleteApiTokenTest.php: -------------------------------------------------------------------------------- 1 | markTestSkipped('API support is not enabled.'); 21 | } 22 | 23 | $this->actingAs($user = User::factory()->withPersonalTeam()->create()); 24 | 25 | $token = $user->tokens()->create([ 26 | 'name' => 'Test Token', 27 | 'token' => Str::random(40), 28 | 'abilities' => ['create', 'read'], 29 | ]); 30 | 31 | Livewire::test(ApiTokenManager::class) 32 | ->set(['apiTokenIdBeingDeleted' => $token->id]) 33 | ->call('deleteApiToken'); 34 | 35 | $this->assertCount(0, $user->fresh()->tokens); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/Feature/EmailVerificationTest.php: -------------------------------------------------------------------------------- 1 | markTestSkipped('Email verification not enabled.'); 22 | } 23 | 24 | $user = User::factory()->create([ 25 | 'email_verified_at' => null, 26 | ]); 27 | 28 | $response = $this->actingAs($user)->get('/email/verify'); 29 | 30 | $response->assertStatus(200); 31 | } 32 | 33 | public function test_email_can_be_verified() 34 | { 35 | if (! Features::enabled(Features::emailVerification())) { 36 | return $this->markTestSkipped('Email verification not enabled.'); 37 | } 38 | 39 | Event::fake(); 40 | 41 | $user = User::factory()->create([ 42 | 'email_verified_at' => null, 43 | ]); 44 | 45 | $verificationUrl = URL::temporarySignedRoute( 46 | 'verification.verify', 47 | now()->addMinutes(60), 48 | ['id' => $user->id, 'hash' => sha1($user->email)] 49 | ); 50 | 51 | $response = $this->actingAs($user)->get($verificationUrl); 52 | 53 | Event::assertDispatched(Verified::class); 54 | 55 | $this->assertTrue($user->fresh()->hasVerifiedEmail()); 56 | $response->assertRedirect(RouteServiceProvider::HOME.'?verified=1'); 57 | } 58 | 59 | public function test_email_can_not_verified_with_invalid_hash() 60 | { 61 | if (! Features::enabled(Features::emailVerification())) { 62 | return $this->markTestSkipped('Email verification not enabled.'); 63 | } 64 | 65 | $user = User::factory()->create([ 66 | 'email_verified_at' => null, 67 | ]); 68 | 69 | $verificationUrl = URL::temporarySignedRoute( 70 | 'verification.verify', 71 | now()->addMinutes(60), 72 | ['id' => $user->id, 'hash' => sha1('wrong-email')] 73 | ); 74 | 75 | $this->actingAs($user)->get($verificationUrl); 76 | 77 | $this->assertFalse($user->fresh()->hasVerifiedEmail()); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/Feature/PasswordConfirmationTest.php: -------------------------------------------------------------------------------- 1 | withPersonalTeam()->create() 18 | : User::factory()->create(); 19 | 20 | $response = $this->actingAs($user)->get('/user/confirm-password'); 21 | 22 | $response->assertStatus(200); 23 | } 24 | 25 | public function test_password_can_be_confirmed() 26 | { 27 | $user = User::factory()->create(); 28 | 29 | $response = $this->actingAs($user)->post('/user/confirm-password', [ 30 | 'password' => 'password', 31 | ]); 32 | 33 | $response->assertRedirect(); 34 | $response->assertSessionHasNoErrors(); 35 | } 36 | 37 | public function test_password_is_not_confirmed_with_invalid_password() 38 | { 39 | $user = User::factory()->create(); 40 | 41 | $response = $this->actingAs($user)->post('/user/confirm-password', [ 42 | 'password' => 'wrong-password', 43 | ]); 44 | 45 | $response->assertSessionHasErrors(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/Feature/PasswordResetTest.php: -------------------------------------------------------------------------------- 1 | get('/forgot-password'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | 22 | public function test_reset_password_link_can_be_requested() 23 | { 24 | Notification::fake(); 25 | 26 | $user = User::factory()->create(); 27 | 28 | $response = $this->post('/forgot-password', [ 29 | 'email' => $user->email, 30 | ]); 31 | 32 | Notification::assertSentTo($user, ResetPassword::class); 33 | } 34 | 35 | public function test_reset_password_screen_can_be_rendered() 36 | { 37 | Notification::fake(); 38 | 39 | $user = User::factory()->create(); 40 | 41 | $response = $this->post('/forgot-password', [ 42 | 'email' => $user->email, 43 | ]); 44 | 45 | Notification::assertSentTo($user, ResetPassword::class, function ($notification) { 46 | $response = $this->get('/reset-password/'.$notification->token); 47 | 48 | $response->assertStatus(200); 49 | 50 | return true; 51 | }); 52 | } 53 | 54 | public function test_password_can_be_reset_with_valid_token() 55 | { 56 | Notification::fake(); 57 | 58 | $user = User::factory()->create(); 59 | 60 | $response = $this->post('/forgot-password', [ 61 | 'email' => $user->email, 62 | ]); 63 | 64 | Notification::assertSentTo($user, ResetPassword::class, function ($notification) use ($user) { 65 | $response = $this->post('/reset-password', [ 66 | 'token' => $notification->token, 67 | 'email' => $user->email, 68 | 'password' => 'password', 69 | 'password_confirmation' => 'password', 70 | ]); 71 | 72 | $response->assertSessionHasNoErrors(); 73 | 74 | return true; 75 | }); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /tests/Feature/ProfileInformationTest.php: -------------------------------------------------------------------------------- 1 | actingAs($user = User::factory()->create()); 18 | 19 | $component = Livewire::test(UpdateProfileInformationForm::class); 20 | 21 | $this->assertEquals($user->name, $component->state['name']); 22 | $this->assertEquals($user->email, $component->state['email']); 23 | } 24 | 25 | public function test_profile_information_can_be_updated() 26 | { 27 | $this->actingAs($user = User::factory()->create()); 28 | 29 | Livewire::test(UpdateProfileInformationForm::class) 30 | ->set('state', ['name' => 'Test Name', 'email' => 'test@example.com']) 31 | ->call('updateProfileInformation'); 32 | 33 | $this->assertEquals('Test Name', $user->fresh()->name); 34 | $this->assertEquals('test@example.com', $user->fresh()->email); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tests/Feature/RegistrationTest.php: -------------------------------------------------------------------------------- 1 | get('/register'); 16 | 17 | $response->assertStatus(200); 18 | } 19 | 20 | public function test_new_users_can_register() 21 | { 22 | $response = $this->post('/register', [ 23 | 'name' => 'Test User', 24 | 'email' => 'test@example.com', 25 | 'password' => 'password', 26 | 'password_confirmation' => 'password', 27 | ]); 28 | 29 | $this->assertAuthenticated(); 30 | $response->assertRedirect(RouteServiceProvider::HOME); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tests/Feature/TwoFactorAuthenticationSettingsTest.php: -------------------------------------------------------------------------------- 1 | actingAs($user = User::factory()->create()); 18 | 19 | $this->withSession(['auth.password_confirmed_at' => time()]); 20 | 21 | Livewire::test(TwoFactorAuthenticationForm::class) 22 | ->call('enableTwoFactorAuthentication'); 23 | 24 | $user = $user->fresh(); 25 | 26 | $this->assertNotNull($user->two_factor_secret); 27 | $this->assertCount(8, $user->recoveryCodes()); 28 | } 29 | 30 | public function test_recovery_codes_can_be_regenerated() 31 | { 32 | $this->actingAs($user = User::factory()->create()); 33 | 34 | $this->withSession(['auth.password_confirmed_at' => time()]); 35 | 36 | $component = Livewire::test(TwoFactorAuthenticationForm::class) 37 | ->call('enableTwoFactorAuthentication') 38 | ->call('regenerateRecoveryCodes'); 39 | 40 | $user = $user->fresh(); 41 | 42 | $component->call('regenerateRecoveryCodes'); 43 | 44 | $this->assertCount(8, $user->recoveryCodes()); 45 | $this->assertCount(8, array_diff($user->recoveryCodes(), $user->fresh()->recoveryCodes())); 46 | } 47 | 48 | public function test_two_factor_authentication_can_be_disabled() 49 | { 50 | $this->actingAs($user = User::factory()->create()); 51 | 52 | $this->withSession(['auth.password_confirmed_at' => time()]); 53 | 54 | $component = Livewire::test(TwoFactorAuthenticationForm::class) 55 | ->call('enableTwoFactorAuthentication'); 56 | 57 | $this->assertNotNull($user->fresh()->two_factor_secret); 58 | 59 | $component->call('disableTwoFactorAuthentication'); 60 | 61 | $this->assertNull($user->fresh()->two_factor_secret); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /tests/Feature/UpdatePasswordTest.php: -------------------------------------------------------------------------------- 1 | actingAs($user = User::factory()->create()); 19 | 20 | Livewire::test(UpdatePasswordForm::class) 21 | ->set('state', [ 22 | 'current_password' => 'password', 23 | 'password' => 'new-password', 24 | 'password_confirmation' => 'new-password', 25 | ]) 26 | ->call('updatePassword'); 27 | 28 | $this->assertTrue(Hash::check('new-password', $user->fresh()->password)); 29 | } 30 | 31 | public function test_current_password_must_be_correct() 32 | { 33 | $this->actingAs($user = User::factory()->create()); 34 | 35 | Livewire::test(UpdatePasswordForm::class) 36 | ->set('state', [ 37 | 'current_password' => 'wrong-password', 38 | 'password' => 'new-password', 39 | 'password_confirmation' => 'new-password', 40 | ]) 41 | ->call('updatePassword') 42 | ->assertHasErrors(['current_password']); 43 | 44 | $this->assertTrue(Hash::check('password', $user->fresh()->password)); 45 | } 46 | 47 | public function test_new_passwords_must_match() 48 | { 49 | $this->actingAs($user = User::factory()->create()); 50 | 51 | Livewire::test(UpdatePasswordForm::class) 52 | ->set('state', [ 53 | 'current_password' => 'password', 54 | 'password' => 'new-password', 55 | 'password_confirmation' => 'wrong-password', 56 | ]) 57 | ->call('updatePassword') 58 | ->assertHasErrors(['password']); 59 | 60 | $this->assertTrue(Hash::check('password', $user->fresh()->password)); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /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 | require('autoprefixer'), 19 | ]); 20 | 21 | if (mix.inProduction()) { 22 | mix.version(); 23 | } 24 | --------------------------------------------------------------------------------