├── .editorconfig ├── .env.example ├── .eslintrc.js ├── .gitattributes ├── .gitignore ├── README.md ├── app ├── Http │ ├── Controllers │ │ ├── AuthController.php │ │ ├── Controller.php │ │ ├── IndexController.php │ │ ├── ListingController.php │ │ ├── ListingOfferController.php │ │ ├── NotificationController.php │ │ ├── NotificationSeenController.php │ │ ├── RealtorListingAcceptOfferController.php │ │ ├── RealtorListingController.php │ │ ├── RealtorListingImageController.php │ │ └── UserAccountController.php │ └── Middleware │ │ └── HandleInertiaRequests.php ├── Models │ ├── Listing.php │ ├── ListingImage.php │ ├── Offer.php │ └── User.php ├── Notifications │ └── OfferMade.php ├── Policies │ ├── ListingPolicy.php │ └── NotificationPolicy.php └── Providers │ └── AppServiceProvider.php ├── artisan ├── bootstrap ├── app.php ├── cache │ └── .gitignore └── providers.php ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── cache.php ├── database.php ├── filesystems.php ├── logging.php ├── mail.php ├── queue.php ├── services.php └── session.php ├── database ├── .gitignore ├── factories │ ├── ListingFactory.php │ └── UserFactory.php ├── migrations │ ├── 0001_01_01_000000_create_users_table.php │ ├── 0001_01_01_000001_create_cache_table.php │ ├── 0001_01_01_000002_create_jobs_table.php │ ├── 2022_09_23_180153_create_listings_table.php │ ├── 2022_09_24_150311_add_fields_to_listings_table.php │ ├── 2022_10_15_180336_add_by_user_id_column_to_listings_table.php │ ├── 2022_10_19_171125_add_is_admin_column_to_users_table.php │ ├── 2022_10_29_152917_add_soft_deletes_to_listings_table.php │ ├── 2022_11_02_172415_create_listing_images_table.php │ ├── 2022_11_07_171140_create_offers_table.php │ ├── 2022_11_11_155253_add_sold_at_column_to_listings_table.php │ └── 2022_11_13_174432_create_notifications_table.php └── seeders │ └── DatabaseSeeder.php ├── docker-compose.yml ├── jsconfig.json ├── lang └── en │ ├── auth.php │ ├── pagination.php │ ├── passwords.php │ └── validation.php ├── package-lock.json ├── package.json ├── phpunit.xml ├── postcss.config.js ├── public ├── .htaccess ├── favicon.ico ├── index.php └── robots.txt ├── resources ├── css │ └── app.css ├── js │ ├── Components │ │ ├── ListingAddress.vue │ │ ├── ListingSpace.vue │ │ ├── Price.vue │ │ └── UI │ │ │ ├── Box.vue │ │ │ ├── EmptyState.vue │ │ │ └── Pagination.vue │ ├── Composables │ │ └── useMonthlyPayment.js │ ├── Layouts │ │ └── MainLayout.vue │ ├── Pages │ │ ├── Auth │ │ │ ├── Login.vue │ │ │ └── VerifyEmail.vue │ │ ├── Index │ │ │ ├── Index.vue │ │ │ └── Show.vue │ │ ├── Listing │ │ │ ├── Index.vue │ │ │ ├── Index │ │ │ │ └── Components │ │ │ │ │ ├── Filters.vue │ │ │ │ │ └── Listing.vue │ │ │ ├── Show.vue │ │ │ └── Show │ │ │ │ └── Components │ │ │ │ ├── MakeOffer.vue │ │ │ │ └── OfferMade.vue │ │ ├── Notification │ │ │ └── Index.vue │ │ ├── Realtor │ │ │ ├── Create.vue │ │ │ ├── Edit.vue │ │ │ ├── Index.vue │ │ │ ├── Index │ │ │ │ └── Components │ │ │ │ │ └── RealtorFilters.vue │ │ │ ├── ListingImage │ │ │ │ └── Create.vue │ │ │ ├── Show.vue │ │ │ └── Show │ │ │ │ └── Components │ │ │ │ └── Offer.vue │ │ └── UserAccount │ │ │ └── Create.vue │ └── app.js └── views │ └── app.blade.php ├── routes ├── console.php └── web.php ├── storage ├── app │ ├── .gitignore │ ├── private │ │ └── .gitignore │ └── public │ │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tailwind.config.js ├── tests ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php └── vite.config.js /.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 | 17 | [docker-compose.yml] 18 | indent_size = 4 19 | -------------------------------------------------------------------------------- /.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_DEPRECATIONS_CHANNEL=null 9 | LOG_LEVEL=debug 10 | 11 | DB_CONNECTION=mysql 12 | DB_HOST=127.0.0.1 13 | DB_PORT=3306 14 | DB_DATABASE=laravel 15 | DB_USERNAME=root 16 | DB_PASSWORD= 17 | 18 | BROADCAST_DRIVER=log 19 | CACHE_DRIVER=file 20 | FILESYSTEM_DISK=local 21 | QUEUE_CONNECTION=sync 22 | SESSION_DRIVER=file 23 | SESSION_LIFETIME=120 24 | 25 | MEMCACHED_HOST=127.0.0.1 26 | 27 | REDIS_HOST=127.0.0.1 28 | REDIS_PASSWORD=null 29 | REDIS_PORT=6379 30 | 31 | MAIL_MAILER=smtp 32 | MAIL_HOST=mailhog 33 | MAIL_PORT=1025 34 | MAIL_USERNAME=null 35 | MAIL_PASSWORD=null 36 | MAIL_ENCRYPTION=null 37 | MAIL_FROM_ADDRESS="hello@example.com" 38 | MAIL_FROM_NAME="${APP_NAME}" 39 | 40 | AWS_ACCESS_KEY_ID= 41 | AWS_SECRET_ACCESS_KEY= 42 | AWS_DEFAULT_REGION=us-east-1 43 | AWS_BUCKET= 44 | AWS_USE_PATH_STYLE_ENDPOINT=false 45 | 46 | PUSHER_APP_ID= 47 | PUSHER_APP_KEY= 48 | PUSHER_APP_SECRET= 49 | PUSHER_HOST= 50 | PUSHER_PORT=443 51 | PUSHER_SCHEME=https 52 | PUSHER_APP_CLUSTER=mt1 53 | 54 | VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 55 | VITE_PUSHER_HOST="${PUSHER_HOST}" 56 | VITE_PUSHER_PORT="${PUSHER_PORT}" 57 | VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" 58 | VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 59 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['eslint:recommended', 'plugin:vue/vue3-recommended'], 3 | parserOptions: { 4 | ecmaVersion: 2020, 5 | sourceType: 'module', 6 | }, 7 | env: { 8 | amd: true, 9 | browser: true, 10 | es6: true, 11 | }, 12 | rules: { 13 | indent: ['error', 2], 14 | quotes: ['warn', 'single'], 15 | semi: ['warn', 'never'], 16 | 'object-curly-spacing': ['error', 'always'], 17 | 'no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: true }], 18 | 'comma-dangle': ['warn', 'always-multiline'], 19 | 'vue/multi-word-component-names': 'off', 20 | 'vue/max-attributes-per-line': 'off', 21 | 'vue/no-v-html': 'off', 22 | 'vue/require-default-prop': 'off', 23 | 'vue/singleline-html-element-content-newline': 'off', 24 | 'vue/html-self-closing': [ 25 | 'warn', 26 | { 27 | html: { 28 | void: 'always', 29 | normal: 'always', 30 | component: 'always', 31 | }, 32 | }, 33 | ], 34 | 'vue/no-v-text-v-html-on-component': 'off', 35 | }, 36 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.blade.php diff=html 4 | *.css diff=css 5 | *.html diff=html 6 | *.md diff=markdown 7 | *.php diff=php 8 | 9 | /.github export-ignore 10 | CHANGELOG.md export-ignore 11 | .styleci.yml export-ignore 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/build 3 | /public/hot 4 | /public/storage 5 | /storage/*.key 6 | /vendor 7 | .env 8 | .env.backup 9 | .phpunit.result.cache 10 | Homestead.json 11 | Homestead.yaml 12 | auth.json 13 | npm-debug.log 14 | yarn-error.log 15 | /.idea 16 | /.vscode 17 | _ide_helper.php 18 | .phpstorm.meta.php -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 |

Piotr Jura - Udemy Instructor

3 |

Piotr Jura Udemy Courses

4 |

Fado Code Camp

5 |
6 | 7 |

8 | High-quality, comprehensive courses for web developers. 9 |

10 | 11 |

12 | About the Instructor · 13 | Courses · 14 | Contact & Links · 15 | This Course Resources 16 |

17 |
18 | 19 | ## About the Instructor 20 | 21 | I am Piotr Jura, a seasoned web developer and a passionate Udemy instructor. With years of experience in JavaScript, TypeScript, Node, PHP, MySQL, Vue, React, and more, I bring practical, real-world knowledge to my students. 22 | 23 | ## Courses 24 | 25 | See [Fado Code Camp](https://fadocodecamp.com/courses) for all my courses. 26 | 27 | ## Contact and Links 28 | 29 | - **My website:** [Fado Code Camp](https://fadocodecamp.com/courses) 30 | - **LinkedIn:** [Follow Me on LinkedIn](https://www.linkedin.com/in/piotr-j-24250b257/) 31 | - **GitHub:** You are here! Give me a follow! 32 | - **Twitter:** [@piotr_jura](https://twitter.com/piotr_jura) 33 | 34 | --- 35 | 36 |

37 | Explore, Learn, and Grow with My Comprehensive Web Development Courses! 38 |

39 | -------------------------------------------------------------------------------- /app/Http/Controllers/AuthController.php: -------------------------------------------------------------------------------- 1 | validate([ 20 | 'email' => 'required|string|email', 21 | 'password' => 'required|string' 22 | ]), true) 23 | ) { 24 | throw ValidationException::withMessages([ 25 | 'email' => 'Authentication failed' 26 | ]); 27 | } 28 | 29 | $request->session()->regenerate(); 30 | 31 | return redirect()->intended('/listing'); 32 | } 33 | 34 | public function destroy(Request $request) 35 | { 36 | Auth::logout(); 37 | 38 | $request->session()->invalidate(); 39 | $request->session()->regenerateToken(); 40 | 41 | return to_route('listing.index'); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | 'Hello from Laravel!' 15 | ] 16 | ); 17 | } 18 | 19 | public function show() 20 | { 21 | return Inertia::render('Index/Show'); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Http/Controllers/ListingController.php: -------------------------------------------------------------------------------- 1 | authorizeResource( 17 | // Listing::class, 18 | // 'listing' 19 | // ); 20 | // } 21 | 22 | public function index(Request $request): Response 23 | { 24 | Gate::authorize( 25 | 'viewAny', 26 | Listing::class 27 | ); 28 | $filters = $request->only([ 29 | 'priceFrom', 30 | 'priceTo', 31 | 'beds', 32 | 'baths', 33 | 'areaFrom', 34 | 'areaTo' 35 | ]); 36 | 37 | return Inertia::render( 38 | 'Listing/Index', 39 | [ 40 | 'filters' => $filters, 41 | 'listings' => Listing::mostRecent() 42 | ->filter($filters) 43 | ->withoutSold() 44 | ->paginate(10) 45 | ->withQueryString() 46 | ] 47 | ); 48 | } 49 | 50 | public function show(Listing $listing): Response 51 | { 52 | Gate::authorize( 53 | 'view', 54 | $listing 55 | ); 56 | $listing->load(['images']); 57 | $offer = !Auth::user() ? 58 | null : $listing->offers()->byMe()->first(); 59 | 60 | return Inertia::render( 61 | 'Listing/Show', 62 | [ 63 | 'listing' => $listing, 64 | 'offerMade' => $offer 65 | ] 66 | ); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/Http/Controllers/ListingOfferController.php: -------------------------------------------------------------------------------- 1 | authorize('view', $listing); 16 | Gate::authorize('view', $listing); 17 | 18 | $offer = $listing->offers()->save( 19 | Offer::make( 20 | $request->validate([ 21 | 'amount' => 'required|integer|min:1|max:20000000' 22 | ]) 23 | )->bidder()->associate($request->user()) 24 | ); 25 | $listing->owner->notify( 26 | new OfferMade($offer) 27 | ); 28 | 29 | return redirect()->back()->with( 30 | 'success', 31 | 'Offer was made!' 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Http/Controllers/NotificationController.php: -------------------------------------------------------------------------------- 1 | $request->user() 16 | ->notifications()->paginate(10) 17 | ] 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Controllers/NotificationSeenController.php: -------------------------------------------------------------------------------- 1 | authorize('update', $notification); 13 | Gate::authorize('update', $notification); 14 | $notification->markAsRead(); 15 | 16 | return redirect()->back() 17 | ->with('success', 'Notification marked as read'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Http/Controllers/RealtorListingAcceptOfferController.php: -------------------------------------------------------------------------------- 1 | listing; 14 | // $this->authorize('update', $listing); 15 | Gate::authorize('update', $listing); 16 | 17 | // Accept selected offer 18 | $offer->update(['accepted_at' => now()]); 19 | 20 | $listing->sold_at = now(); 21 | $listing->save(); 22 | 23 | // Reject all other offers 24 | $listing->offers()->except($offer) 25 | ->update(['rejected_at' => now()]); 26 | 27 | return redirect()->back() 28 | ->with( 29 | 'success', 30 | "Offer #{$offer->id} accepted, other offers rejected" 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Http/Controllers/RealtorListingController.php: -------------------------------------------------------------------------------- 1 | authorizeResource(Listing::class, 'listing'); 17 | // } 18 | 19 | public function index(Request $request) 20 | { 21 | Gate::authorize( 22 | 'viewAny', 23 | Listing::class 24 | ); 25 | $filters = [ 26 | 'deleted' => $request->boolean('deleted'), 27 | ...$request->only(['by', 'order']) 28 | ]; 29 | 30 | return Inertia::render( 31 | 'Realtor/Index', 32 | [ 33 | 'filters' => $filters, 34 | 'listings' => Auth::user() 35 | ->listings() 36 | ->filter($filters) 37 | ->withCount('images') 38 | ->withCount('offers') 39 | ->paginate(5) 40 | ->withQueryString() 41 | ] 42 | ); 43 | } 44 | 45 | public function show(Listing $listing): Response 46 | { 47 | Gate::authorize( 48 | 'view', 49 | $listing 50 | ); 51 | return Inertia::render( 52 | 'Realtor/Show', 53 | [ 54 | 'listing' => $listing->load( 55 | 'offers', 56 | 'offers.bidder' 57 | ) 58 | ] 59 | ); 60 | } 61 | 62 | public function create(): Response 63 | { 64 | Gate::authorize( 65 | 'create', 66 | Listing::class 67 | ); 68 | return Inertia::render('Realtor/Create'); 69 | } 70 | 71 | public function store(Request $request) 72 | { 73 | Gate::authorize( 74 | 'create', 75 | Listing::class 76 | ); 77 | $request->user()->listings()->create( 78 | $request->validate([ 79 | 'beds' => 'required|integer|min:0|max:20', 80 | 'baths' => 'required|integer|min:0|max:20', 81 | 'area' => 'required|integer|min:15|max:1500', 82 | 'city' => 'required', 83 | 'code' => 'required', 84 | 'street' => 'required', 85 | 'street_nr' => 'required|min:1|max:1000', 86 | 'price' => 'required|integer|min:1|max:20000000', 87 | ]) 88 | ); 89 | 90 | return redirect()->route('realtor.listing.index') 91 | ->with('success', 'Listing was created!'); 92 | } 93 | 94 | public function edit(Listing $listing) 95 | { 96 | Gate::authorize( 97 | 'update', 98 | $listing 99 | ); 100 | return Inertia::render( 101 | 'Realtor/Edit', 102 | [ 103 | 'listing' => $listing 104 | ] 105 | ); 106 | } 107 | 108 | public function update(Request $request, Listing $listing) 109 | { 110 | Gate::authorize( 111 | 'update', 112 | $listing 113 | ); 114 | $listing->update( 115 | $request->validate([ 116 | 'beds' => 'required|integer|min:0|max:20', 117 | 'baths' => 'required|integer|min:0|max:20', 118 | 'area' => 'required|integer|min:15|max:1500', 119 | 'city' => 'required', 120 | 'code' => 'required', 121 | 'street' => 'required', 122 | 'street_nr' => 'required|min:1|max:1000', 123 | 'price' => 'required|integer|min:1|max:20000000', 124 | ]) 125 | ); 126 | 127 | return redirect()->route('realtor.listing.index') 128 | ->with('success', 'Listing was changed!'); 129 | } 130 | 131 | public function destroy(Listing $listing) 132 | { 133 | Gate::authorize( 134 | 'delete', 135 | $listing 136 | ); 137 | $listing->deleteOrFail(); 138 | 139 | return redirect()->back() 140 | ->with('success', 'Listing was deleted!'); 141 | } 142 | 143 | public function restore(Listing $listing) 144 | { 145 | Gate::authorize( 146 | 'restore', 147 | $listing 148 | ); 149 | $listing->restore(); 150 | 151 | return redirect()->back()->with('success', 'Listing was restored!'); 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /app/Http/Controllers/RealtorListingImageController.php: -------------------------------------------------------------------------------- 1 | load(['images']); 15 | return inertia( 16 | 'Realtor/ListingImage/Create', 17 | ['listing' => $listing] 18 | ); 19 | } 20 | 21 | public function store(Listing $listing, Request $request) 22 | { 23 | if ($request->hasFile('images')) { 24 | $request->validate([ 25 | 'images.*' => 'mimes:jpg,png,jpeg,webp|max:5000' 26 | ], [ 27 | 'images.*.mimes' => 'The file should be in one of the formats: jpg, png, jpeg, webp' 28 | ]); 29 | 30 | foreach ($request->file('images') as $file) { 31 | $path = $file->store('images', 'public'); 32 | 33 | $listing->images()->save(new ListingImage([ 34 | 'filename' => $path 35 | ])); 36 | } 37 | } 38 | 39 | return redirect()->back()->with('success', 'Images uploaded!'); 40 | } 41 | 42 | public function destroy($listing, ListingImage $image) 43 | { 44 | Storage::disk('public')->delete($image->filename); 45 | $image->delete(); 46 | 47 | return redirect()->back()->with('success', 'Image was deleted!'); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/Http/Controllers/UserAccountController.php: -------------------------------------------------------------------------------- 1 | validate([ 21 | 'name' => 'required', 22 | 'email' => 'required|email|unique:users', 23 | 'password' => 'required|min:8|confirmed' 24 | ])); 25 | // $user->save(); 26 | Auth::login($user); 27 | event(new Registered($user)); 28 | 29 | return redirect()->route('listing.index') 30 | ->with('success', 'Account created!'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Middleware/HandleInertiaRequests.php: -------------------------------------------------------------------------------- 1 | 35 | */ 36 | public function share(Request $request): array 37 | { 38 | return array_merge(parent::share($request), [ 39 | 'flash' => [ 40 | 'success' => $request->session()->get('success') 41 | ], 42 | 'user' => $request->user() ? [ 43 | 'id' => $request->user()->id, 44 | 'name' => $request->user()->name, 45 | 'email' => $request->user()->email, 46 | 'notificationCount' => $request->user()->unreadNotifications()->count() 47 | ] : null 48 | ]); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/Models/Listing.php: -------------------------------------------------------------------------------- 1 | belongsTo( 26 | \App\Models\User::class, 27 | 'by_user_id' 28 | ); 29 | } 30 | 31 | public function images(): HasMany 32 | { 33 | return $this->hasMany(ListingImage::class); 34 | } 35 | 36 | public function offers(): HasMany 37 | { 38 | return $this->hasMany(Offer::class, 'listing_id'); 39 | } 40 | 41 | public function scopeMostRecent(Builder $query): Builder 42 | { 43 | return $query->orderByDesc('created_at'); 44 | } 45 | 46 | public function scopeWithoutSold(Builder $query): Builder 47 | { 48 | // return $query->doesntHave('offers') 49 | // ->orWhereHas( 50 | // 'offers', 51 | // fn (Builder $query) => $query->whereNull('accepted_at') 52 | // ->whereNull('rejected_at') 53 | // ); 54 | return $query->whereNull('sold_at'); 55 | } 56 | 57 | public function scopeFilter(Builder $query, array $filters): Builder 58 | { 59 | return $query->when( 60 | $filters['priceFrom'] ?? false, 61 | fn ($query, $value) => $query->where('price', '>=', $value) 62 | )->when( 63 | $filters['priceTo'] ?? false, 64 | fn ($query, $value) => $query->where('price', '<=', $value) 65 | )->when( 66 | $filters['beds'] ?? false, 67 | fn ($query, $value) => $query->where('beds', (int)$value < 6 ? '=' : '>=', $value) 68 | )->when( 69 | $filters['baths'] ?? false, 70 | fn ($query, $value) => $query->where('baths', (int)$value < 6 ? '=' : '>=', $value) 71 | )->when( 72 | $filters['areaFrom'] ?? false, 73 | fn ($query, $value) => $query->where('area', '>=', $value) 74 | )->when( 75 | $filters['areaTo'] ?? false, 76 | fn ($query, $value) => $query->where('area', '<=', $value) 77 | )->when( 78 | $filters['deleted'] ?? false, 79 | fn ($query, $value) => $query->withTrashed() 80 | )->when( 81 | $filters['by'] ?? false, 82 | fn ($query, $value) => 83 | !in_array($value, $this->sortable) 84 | ? $query : 85 | $query->orderBy($value, $filters['order'] ?? 'desc') 86 | ); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /app/Models/ListingImage.php: -------------------------------------------------------------------------------- 1 | belongsTo(Listing::class); 19 | } 20 | 21 | // getRealSrcAttribute -> real_src 22 | public function getSrcAttribute() 23 | { 24 | return asset("storage/{$this->filename}"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Models/Offer.php: -------------------------------------------------------------------------------- 1 | belongsTo(Listing::class, 'listing_id'); 20 | } 21 | 22 | public function bidder(): BelongsTo 23 | { 24 | return $this->belongsTo(User::class, 'bidder_id'); 25 | } 26 | 27 | public function scopeByMe(Builder $query): Builder 28 | { 29 | return $query->where('bidder_id', Auth::user()?->id); 30 | } 31 | 32 | public function scopeExcept(Builder $query, Offer $offer): Builder 33 | { 34 | return $query->where('id', '!=', $offer->id); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | */ 15 | use HasFactory, Notifiable; 16 | 17 | /** 18 | * The attributes that are mass assignable. 19 | * 20 | * @var array 21 | */ 22 | protected $fillable = [ 23 | 'name', 24 | 'email', 25 | 'password', 26 | ]; 27 | 28 | /** 29 | * The attributes that should be hidden for serialization. 30 | * 31 | * @var array 32 | */ 33 | protected $hidden = [ 34 | 'password', 35 | 'remember_token', 36 | ]; 37 | 38 | /** 39 | * Get the attributes that should be cast. 40 | * 41 | * @return array 42 | */ 43 | protected function casts(): array 44 | { 45 | return [ 46 | 'email_verified_at' => 'datetime', 47 | 'password' => 'hashed', 48 | ]; 49 | } 50 | 51 | protected function password(): Attribute 52 | { 53 | return Attribute::make( 54 | get: fn($value) => $value, 55 | set: fn($value) => Hash::make($value), 56 | ); 57 | } 58 | 59 | public function listings(): HasMany 60 | { 61 | return $this->hasMany( 62 | Listing::class, 63 | 'by_user_id' 64 | ); 65 | } 66 | 67 | public function offers(): HasMany 68 | { 69 | return $this->hasMany( 70 | Offer::class, 71 | 'bidder_id' 72 | ); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /app/Notifications/OfferMade.php: -------------------------------------------------------------------------------- 1 | 28 | */ 29 | public function via(object $notifiable): array 30 | { 31 | return ['database', 'mail']; 32 | } 33 | 34 | /** 35 | * Get the mail representation of the notification. 36 | */ 37 | public function toMail(object $notifiable): MailMessage 38 | { 39 | return (new MailMessage) 40 | ->line("New offer ({$this->offer->amount}) was made for your listing") 41 | ->action( 42 | 'See Your Listing', 43 | route('realtor.listing.show', ['listing' => $this->offer->listing_id]) 44 | ) 45 | ->line('Thank you for using our application!'); 46 | } 47 | 48 | /** 49 | * Get the array representation of the notification. 50 | * 51 | * @return array 52 | */ 53 | public function toArray(object $notifiable): array 54 | { 55 | return [ 56 | 'offer_id' => $this->offer->id, 57 | 'listing_id' => $this->offer->listing_id, 58 | 'amount' => $this->offer->amount, 59 | 'bidder_id' => $this->offer->bidder_id 60 | ]; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/Policies/ListingPolicy.php: -------------------------------------------------------------------------------- 1 | by_user_id === $user?->id) { 25 | return true; 26 | } 27 | 28 | return $listing->sold_at === null; 29 | } 30 | 31 | /** 32 | * Determine whether the user can create models. 33 | */ 34 | public function create(User $user): bool 35 | { 36 | return true; 37 | } 38 | 39 | /** 40 | * Determine whether the user can update the model. 41 | */ 42 | public function update(User $user, Listing $listing): bool 43 | { 44 | return $listing->sold_at === null 45 | && ($user->id === $listing->by_user_id); 46 | } 47 | 48 | /** 49 | * Determine whether the user can delete the model. 50 | */ 51 | public function delete(User $user, Listing $listing): bool 52 | { 53 | return $user->id === $listing->by_user_id; 54 | } 55 | 56 | /** 57 | * Determine whether the user can restore the model. 58 | */ 59 | public function restore(User $user, Listing $listing): bool 60 | { 61 | return $user->id === $listing->by_user_id; 62 | } 63 | 64 | /** 65 | * Determine whether the user can permanently delete the model. 66 | */ 67 | public function forceDelete(User $user, Listing $listing): bool 68 | { 69 | return $user->id === $listing->by_user_id; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/Policies/NotificationPolicy.php: -------------------------------------------------------------------------------- 1 | id === $databaseNotification->notifiable_id; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | handleCommand(new ArgvInput); 14 | 15 | exit($status); 16 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | withRouting( 10 | web: __DIR__ . '/../routes/web.php', 11 | commands: __DIR__ . '/../routes/console.php', 12 | health: '/up', 13 | ) 14 | ->withMiddleware(function (Middleware $middleware) { 15 | $middleware->web(append: [ 16 | HandleInertiaRequests::class, 17 | ]); 18 | }) 19 | ->withExceptions(function (Exceptions $exceptions) { 20 | // 21 | })->create(); 22 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /bootstrap/providers.php: -------------------------------------------------------------------------------- 1 | env('APP_NAME', 'Laravel'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Application Environment 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This value determines the "environment" your application is currently 24 | | running in. This may determine how you prefer to configure various 25 | | services the application utilizes. Set this in your ".env" file. 26 | | 27 | */ 28 | 29 | 'env' => env('APP_ENV', 'production'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Application Debug Mode 34 | |-------------------------------------------------------------------------- 35 | | 36 | | When your application is in debug mode, detailed error messages with 37 | | stack traces will be shown on every error that occurs within your 38 | | application. If disabled, a simple generic error page is shown. 39 | | 40 | */ 41 | 42 | 'debug' => (bool) env('APP_DEBUG', false), 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Application URL 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This URL is used by the console to properly generate URLs when using 50 | | the Artisan command line tool. You should set this to the root of 51 | | the application so that it's available within Artisan commands. 52 | | 53 | */ 54 | 55 | 'url' => env('APP_URL', 'http://localhost'), 56 | 57 | /* 58 | |-------------------------------------------------------------------------- 59 | | Application Timezone 60 | |-------------------------------------------------------------------------- 61 | | 62 | | Here you may specify the default timezone for your application, which 63 | | will be used by the PHP date and date-time functions. The timezone 64 | | is set to "UTC" by default as it is suitable for most use cases. 65 | | 66 | */ 67 | 68 | 'timezone' => env('APP_TIMEZONE', 'UTC'), 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Application Locale Configuration 73 | |-------------------------------------------------------------------------- 74 | | 75 | | The application locale determines the default locale that will be used 76 | | by Laravel's translation / localization methods. This option can be 77 | | set to any locale for which you plan to have translation strings. 78 | | 79 | */ 80 | 81 | 'locale' => env('APP_LOCALE', 'en'), 82 | 83 | 'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'), 84 | 85 | 'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'), 86 | 87 | /* 88 | |-------------------------------------------------------------------------- 89 | | Encryption Key 90 | |-------------------------------------------------------------------------- 91 | | 92 | | This key is utilized by Laravel's encryption services and should be set 93 | | to a random, 32 character string to ensure that all encrypted values 94 | | are secure. You should do this prior to deploying the application. 95 | | 96 | */ 97 | 98 | 'cipher' => 'AES-256-CBC', 99 | 100 | 'key' => env('APP_KEY'), 101 | 102 | 'previous_keys' => [ 103 | ...array_filter( 104 | explode(',', env('APP_PREVIOUS_KEYS', '')) 105 | ), 106 | ], 107 | 108 | /* 109 | |-------------------------------------------------------------------------- 110 | | Maintenance Mode Driver 111 | |-------------------------------------------------------------------------- 112 | | 113 | | These configuration options determine the driver used to determine and 114 | | manage Laravel's "maintenance mode" status. The "cache" driver will 115 | | allow maintenance mode to be controlled across multiple machines. 116 | | 117 | | Supported drivers: "file", "cache" 118 | | 119 | */ 120 | 121 | 'maintenance' => [ 122 | 'driver' => env('APP_MAINTENANCE_DRIVER', 'file'), 123 | 'store' => env('APP_MAINTENANCE_STORE', 'database'), 124 | ], 125 | 126 | ]; 127 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => env('AUTH_GUARD', 'web'), 18 | 'passwords' => env('AUTH_PASSWORD_BROKER', 'users'), 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | which utilizes session storage plus the Eloquent user provider. 29 | | 30 | | All authentication guards have a user provider, which defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | system used by the application. Typically, Eloquent is utilized. 33 | | 34 | | Supported: "session" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | ], 44 | 45 | /* 46 | |-------------------------------------------------------------------------- 47 | | User Providers 48 | |-------------------------------------------------------------------------- 49 | | 50 | | All authentication guards have a user provider, which defines how the 51 | | users are actually retrieved out of your database or other storage 52 | | system used by the application. Typically, Eloquent is utilized. 53 | | 54 | | If you have multiple user tables or models you may configure multiple 55 | | providers to represent the model / table. These providers may then 56 | | be assigned to any extra authentication guards you have defined. 57 | | 58 | | Supported: "database", "eloquent" 59 | | 60 | */ 61 | 62 | 'providers' => [ 63 | 'users' => [ 64 | 'driver' => 'eloquent', 65 | 'model' => env('AUTH_MODEL', App\Models\User::class), 66 | ], 67 | 68 | // 'users' => [ 69 | // 'driver' => 'database', 70 | // 'table' => 'users', 71 | // ], 72 | ], 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Resetting Passwords 77 | |-------------------------------------------------------------------------- 78 | | 79 | | These configuration options specify the behavior of Laravel's password 80 | | reset functionality, including the table utilized for token storage 81 | | and the user provider that is invoked to actually retrieve users. 82 | | 83 | | The expiry time is the number of minutes that each reset token will be 84 | | considered valid. This security feature keeps tokens short-lived so 85 | | they have less time to be guessed. You may change this as needed. 86 | | 87 | | The throttle setting is the number of seconds a user must wait before 88 | | generating more password reset tokens. This prevents the user from 89 | | quickly generating a very large amount of password reset tokens. 90 | | 91 | */ 92 | 93 | 'passwords' => [ 94 | 'users' => [ 95 | 'provider' => 'users', 96 | 'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'), 97 | 'expire' => 60, 98 | 'throttle' => 60, 99 | ], 100 | ], 101 | 102 | /* 103 | |-------------------------------------------------------------------------- 104 | | Password Confirmation Timeout 105 | |-------------------------------------------------------------------------- 106 | | 107 | | Here you may define the amount of seconds before a password confirmation 108 | | window expires and users are asked to re-enter their password via the 109 | | confirmation screen. By default, the timeout lasts for three hours. 110 | | 111 | */ 112 | 113 | 'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800), 114 | 115 | ]; 116 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_STORE', 'database'), 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: "array", "database", "file", "memcached", 30 | | "redis", "dynamodb", "octane", "null" 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'array' => [ 37 | 'driver' => 'array', 38 | 'serialize' => false, 39 | ], 40 | 41 | 'database' => [ 42 | 'driver' => 'database', 43 | 'connection' => env('DB_CACHE_CONNECTION'), 44 | 'table' => env('DB_CACHE_TABLE', 'cache'), 45 | 'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'), 46 | 'lock_table' => env('DB_CACHE_LOCK_TABLE'), 47 | ], 48 | 49 | 'file' => [ 50 | 'driver' => 'file', 51 | 'path' => storage_path('framework/cache/data'), 52 | 'lock_path' => storage_path('framework/cache/data'), 53 | ], 54 | 55 | 'memcached' => [ 56 | 'driver' => 'memcached', 57 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 58 | 'sasl' => [ 59 | env('MEMCACHED_USERNAME'), 60 | env('MEMCACHED_PASSWORD'), 61 | ], 62 | 'options' => [ 63 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 64 | ], 65 | 'servers' => [ 66 | [ 67 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 68 | 'port' => env('MEMCACHED_PORT', 11211), 69 | 'weight' => 100, 70 | ], 71 | ], 72 | ], 73 | 74 | 'redis' => [ 75 | 'driver' => 'redis', 76 | 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'), 77 | 'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'), 78 | ], 79 | 80 | 'dynamodb' => [ 81 | 'driver' => 'dynamodb', 82 | 'key' => env('AWS_ACCESS_KEY_ID'), 83 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 84 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 85 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 86 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 87 | ], 88 | 89 | 'octane' => [ 90 | 'driver' => 'octane', 91 | ], 92 | 93 | ], 94 | 95 | /* 96 | |-------------------------------------------------------------------------- 97 | | Cache Key Prefix 98 | |-------------------------------------------------------------------------- 99 | | 100 | | When utilizing the APC, database, memcached, Redis, and DynamoDB cache 101 | | stores, there might be other applications using the same cache. For 102 | | that reason, you may prefix every cache key to avoid collisions. 103 | | 104 | */ 105 | 106 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), 107 | 108 | ]; 109 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'sqlite'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Database Connections 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Below are all of the database connections defined for your application. 27 | | An example configuration is provided for each database system which 28 | | is supported by Laravel. You're free to add / remove connections. 29 | | 30 | */ 31 | 32 | 'connections' => [ 33 | 34 | 'sqlite' => [ 35 | 'driver' => 'sqlite', 36 | 'url' => env('DB_URL'), 37 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 38 | 'prefix' => '', 39 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), 40 | 'busy_timeout' => null, 41 | 'journal_mode' => null, 42 | 'synchronous' => null, 43 | ], 44 | 45 | 'mysql' => [ 46 | 'driver' => 'mysql', 47 | 'url' => env('DB_URL'), 48 | 'host' => env('DB_HOST', '127.0.0.1'), 49 | 'port' => env('DB_PORT', '3306'), 50 | 'database' => env('DB_DATABASE', 'laravel'), 51 | 'username' => env('DB_USERNAME', 'root'), 52 | 'password' => env('DB_PASSWORD', ''), 53 | 'unix_socket' => env('DB_SOCKET', ''), 54 | 'charset' => env('DB_CHARSET', 'utf8mb4'), 55 | 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), 56 | 'prefix' => '', 57 | 'prefix_indexes' => true, 58 | 'strict' => true, 59 | 'engine' => null, 60 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ 61 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), 62 | ]) : [], 63 | ], 64 | 65 | 'mariadb' => [ 66 | 'driver' => 'mariadb', 67 | 'url' => env('DB_URL'), 68 | 'host' => env('DB_HOST', '127.0.0.1'), 69 | 'port' => env('DB_PORT', '3306'), 70 | 'database' => env('DB_DATABASE', 'laravel'), 71 | 'username' => env('DB_USERNAME', 'root'), 72 | 'password' => env('DB_PASSWORD', ''), 73 | 'unix_socket' => env('DB_SOCKET', ''), 74 | 'charset' => env('DB_CHARSET', 'utf8mb4'), 75 | 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), 76 | 'prefix' => '', 77 | 'prefix_indexes' => true, 78 | 'strict' => true, 79 | 'engine' => null, 80 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ 81 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), 82 | ]) : [], 83 | ], 84 | 85 | 'pgsql' => [ 86 | 'driver' => 'pgsql', 87 | 'url' => env('DB_URL'), 88 | 'host' => env('DB_HOST', '127.0.0.1'), 89 | 'port' => env('DB_PORT', '5432'), 90 | 'database' => env('DB_DATABASE', 'laravel'), 91 | 'username' => env('DB_USERNAME', 'root'), 92 | 'password' => env('DB_PASSWORD', ''), 93 | 'charset' => env('DB_CHARSET', 'utf8'), 94 | 'prefix' => '', 95 | 'prefix_indexes' => true, 96 | 'search_path' => 'public', 97 | 'sslmode' => 'prefer', 98 | ], 99 | 100 | 'sqlsrv' => [ 101 | 'driver' => 'sqlsrv', 102 | 'url' => env('DB_URL'), 103 | 'host' => env('DB_HOST', 'localhost'), 104 | 'port' => env('DB_PORT', '1433'), 105 | 'database' => env('DB_DATABASE', 'laravel'), 106 | 'username' => env('DB_USERNAME', 'root'), 107 | 'password' => env('DB_PASSWORD', ''), 108 | 'charset' => env('DB_CHARSET', 'utf8'), 109 | 'prefix' => '', 110 | 'prefix_indexes' => true, 111 | // 'encrypt' => env('DB_ENCRYPT', 'yes'), 112 | // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), 113 | ], 114 | 115 | ], 116 | 117 | /* 118 | |-------------------------------------------------------------------------- 119 | | Migration Repository Table 120 | |-------------------------------------------------------------------------- 121 | | 122 | | This table keeps track of all the migrations that have already run for 123 | | your application. Using this information, we can determine which of 124 | | the migrations on disk haven't actually been run on the database. 125 | | 126 | */ 127 | 128 | 'migrations' => [ 129 | 'table' => 'migrations', 130 | 'update_date_on_publish' => true, 131 | ], 132 | 133 | /* 134 | |-------------------------------------------------------------------------- 135 | | Redis Databases 136 | |-------------------------------------------------------------------------- 137 | | 138 | | Redis is an open source, fast, and advanced key-value store that also 139 | | provides a richer body of commands than a typical key-value system 140 | | such as Memcached. You may define your connection settings here. 141 | | 142 | */ 143 | 144 | 'redis' => [ 145 | 146 | 'client' => env('REDIS_CLIENT', 'phpredis'), 147 | 148 | 'options' => [ 149 | 'cluster' => env('REDIS_CLUSTER', 'redis'), 150 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), 151 | ], 152 | 153 | 'default' => [ 154 | 'url' => env('REDIS_URL'), 155 | 'host' => env('REDIS_HOST', '127.0.0.1'), 156 | 'username' => env('REDIS_USERNAME'), 157 | 'password' => env('REDIS_PASSWORD'), 158 | 'port' => env('REDIS_PORT', '6379'), 159 | 'database' => env('REDIS_DB', '0'), 160 | ], 161 | 162 | 'cache' => [ 163 | 'url' => env('REDIS_URL'), 164 | 'host' => env('REDIS_HOST', '127.0.0.1'), 165 | 'username' => env('REDIS_USERNAME'), 166 | 'password' => env('REDIS_PASSWORD'), 167 | 'port' => env('REDIS_PORT', '6379'), 168 | 'database' => env('REDIS_CACHE_DB', '1'), 169 | ], 170 | 171 | ], 172 | 173 | ]; 174 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DISK', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Filesystem Disks 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Below you may configure as many filesystem disks as necessary, and you 24 | | may even configure multiple disks for the same driver. Examples for 25 | | most supported storage drivers are configured here for reference. 26 | | 27 | | Supported drivers: "local", "ftp", "sftp", "s3" 28 | | 29 | */ 30 | 31 | 'disks' => [ 32 | 33 | 'local' => [ 34 | 'driver' => 'local', 35 | 'root' => storage_path('app/private'), 36 | 'serve' => true, 37 | 'throw' => false, 38 | ], 39 | 40 | 'public' => [ 41 | 'driver' => 'local', 42 | 'root' => storage_path('app/public'), 43 | 'url' => env('APP_URL').'/storage', 44 | 'visibility' => 'public', 45 | 'throw' => false, 46 | ], 47 | 48 | 's3' => [ 49 | 'driver' => 's3', 50 | 'key' => env('AWS_ACCESS_KEY_ID'), 51 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 52 | 'region' => env('AWS_DEFAULT_REGION'), 53 | 'bucket' => env('AWS_BUCKET'), 54 | 'url' => env('AWS_URL'), 55 | 'endpoint' => env('AWS_ENDPOINT'), 56 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 57 | 'throw' => false, 58 | ], 59 | 60 | ], 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Symbolic Links 65 | |-------------------------------------------------------------------------- 66 | | 67 | | Here you may configure the symbolic links that will be created when the 68 | | `storage:link` Artisan command is executed. The array keys should be 69 | | the locations of the links and the values should be their targets. 70 | | 71 | */ 72 | 73 | 'links' => [ 74 | public_path('storage') => storage_path('app/public'), 75 | ], 76 | 77 | ]; 78 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Deprecations Log Channel 26 | |-------------------------------------------------------------------------- 27 | | 28 | | This option controls the log channel that should be used to log warnings 29 | | regarding deprecated PHP and library features. This allows you to get 30 | | your application ready for upcoming major versions of dependencies. 31 | | 32 | */ 33 | 34 | 'deprecations' => [ 35 | 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), 36 | 'trace' => env('LOG_DEPRECATIONS_TRACE', false), 37 | ], 38 | 39 | /* 40 | |-------------------------------------------------------------------------- 41 | | Log Channels 42 | |-------------------------------------------------------------------------- 43 | | 44 | | Here you may configure the log channels for your application. Laravel 45 | | utilizes the Monolog PHP logging library, which includes a variety 46 | | of powerful log handlers and formatters that you're free to use. 47 | | 48 | | Available drivers: "single", "daily", "slack", "syslog", 49 | | "errorlog", "monolog", "custom", "stack" 50 | | 51 | */ 52 | 53 | 'channels' => [ 54 | 55 | 'stack' => [ 56 | 'driver' => 'stack', 57 | 'channels' => explode(',', env('LOG_STACK', 'single')), 58 | 'ignore_exceptions' => false, 59 | ], 60 | 61 | 'single' => [ 62 | 'driver' => 'single', 63 | 'path' => storage_path('logs/laravel.log'), 64 | 'level' => env('LOG_LEVEL', 'debug'), 65 | 'replace_placeholders' => true, 66 | ], 67 | 68 | 'daily' => [ 69 | 'driver' => 'daily', 70 | 'path' => storage_path('logs/laravel.log'), 71 | 'level' => env('LOG_LEVEL', 'debug'), 72 | 'days' => env('LOG_DAILY_DAYS', 14), 73 | 'replace_placeholders' => true, 74 | ], 75 | 76 | 'slack' => [ 77 | 'driver' => 'slack', 78 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 79 | 'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'), 80 | 'emoji' => env('LOG_SLACK_EMOJI', ':boom:'), 81 | 'level' => env('LOG_LEVEL', 'critical'), 82 | 'replace_placeholders' => true, 83 | ], 84 | 85 | 'papertrail' => [ 86 | 'driver' => 'monolog', 87 | 'level' => env('LOG_LEVEL', 'debug'), 88 | 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), 89 | 'handler_with' => [ 90 | 'host' => env('PAPERTRAIL_URL'), 91 | 'port' => env('PAPERTRAIL_PORT'), 92 | 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), 93 | ], 94 | 'processors' => [PsrLogMessageProcessor::class], 95 | ], 96 | 97 | 'stderr' => [ 98 | 'driver' => 'monolog', 99 | 'level' => env('LOG_LEVEL', 'debug'), 100 | 'handler' => StreamHandler::class, 101 | 'formatter' => env('LOG_STDERR_FORMATTER'), 102 | 'with' => [ 103 | 'stream' => 'php://stderr', 104 | ], 105 | 'processors' => [PsrLogMessageProcessor::class], 106 | ], 107 | 108 | 'syslog' => [ 109 | 'driver' => 'syslog', 110 | 'level' => env('LOG_LEVEL', 'debug'), 111 | 'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER), 112 | 'replace_placeholders' => true, 113 | ], 114 | 115 | 'errorlog' => [ 116 | 'driver' => 'errorlog', 117 | 'level' => env('LOG_LEVEL', 'debug'), 118 | 'replace_placeholders' => true, 119 | ], 120 | 121 | 'null' => [ 122 | 'driver' => 'monolog', 123 | 'handler' => NullHandler::class, 124 | ], 125 | 126 | 'emergency' => [ 127 | 'path' => storage_path('logs/laravel.log'), 128 | ], 129 | 130 | ], 131 | 132 | ]; 133 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_MAILER', 'log'), 18 | 19 | /* 20 | |-------------------------------------------------------------------------- 21 | | Mailer Configurations 22 | |-------------------------------------------------------------------------- 23 | | 24 | | Here you may configure all of the mailers used by your application plus 25 | | their respective settings. Several examples have been configured for 26 | | you and you are free to add your own as your application requires. 27 | | 28 | | Laravel supports a variety of mail "transport" drivers that can be used 29 | | when delivering an email. You may specify which one you're using for 30 | | your mailers below. You may also add additional mailers if needed. 31 | | 32 | | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2", 33 | | "postmark", "resend", "log", "array", 34 | | "failover", "roundrobin" 35 | | 36 | */ 37 | 38 | 'mailers' => [ 39 | 40 | 'smtp' => [ 41 | 'transport' => 'smtp', 42 | 'url' => env('MAIL_URL'), 43 | 'host' => env('MAIL_HOST', '127.0.0.1'), 44 | 'port' => env('MAIL_PORT', 2525), 45 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 46 | 'username' => env('MAIL_USERNAME'), 47 | 'password' => env('MAIL_PASSWORD'), 48 | 'timeout' => null, 49 | 'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)), 50 | ], 51 | 52 | 'ses' => [ 53 | 'transport' => 'ses', 54 | ], 55 | 56 | 'postmark' => [ 57 | 'transport' => 'postmark', 58 | // 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'), 59 | // 'client' => [ 60 | // 'timeout' => 5, 61 | // ], 62 | ], 63 | 64 | 'resend' => [ 65 | 'transport' => 'resend', 66 | ], 67 | 68 | 'sendmail' => [ 69 | 'transport' => 'sendmail', 70 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), 71 | ], 72 | 73 | 'log' => [ 74 | 'transport' => 'log', 75 | 'channel' => env('MAIL_LOG_CHANNEL'), 76 | ], 77 | 78 | 'array' => [ 79 | 'transport' => 'array', 80 | ], 81 | 82 | 'failover' => [ 83 | 'transport' => 'failover', 84 | 'mailers' => [ 85 | 'smtp', 86 | 'log', 87 | ], 88 | ], 89 | 90 | 'roundrobin' => [ 91 | 'transport' => 'roundrobin', 92 | 'mailers' => [ 93 | 'ses', 94 | 'postmark', 95 | ], 96 | ], 97 | 98 | ], 99 | 100 | /* 101 | |-------------------------------------------------------------------------- 102 | | Global "From" Address 103 | |-------------------------------------------------------------------------- 104 | | 105 | | You may wish for all emails sent by your application to be sent from 106 | | the same address. Here you may specify a name and address that is 107 | | used globally for all emails that are sent by your application. 108 | | 109 | */ 110 | 111 | 'from' => [ 112 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 113 | 'name' => env('MAIL_FROM_NAME', 'Example'), 114 | ], 115 | 116 | ]; 117 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'database'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection options for every queue backend 24 | | used by your application. An example configuration is provided for 25 | | each backend supported by Laravel. You're also 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 | 'connection' => env('DB_QUEUE_CONNECTION'), 40 | 'table' => env('DB_QUEUE_TABLE', 'jobs'), 41 | 'queue' => env('DB_QUEUE', 'default'), 42 | 'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90), 43 | 'after_commit' => false, 44 | ], 45 | 46 | 'beanstalkd' => [ 47 | 'driver' => 'beanstalkd', 48 | 'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'), 49 | 'queue' => env('BEANSTALKD_QUEUE', 'default'), 50 | 'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90), 51 | 'block_for' => 0, 52 | 'after_commit' => false, 53 | ], 54 | 55 | 'sqs' => [ 56 | 'driver' => 'sqs', 57 | 'key' => env('AWS_ACCESS_KEY_ID'), 58 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 59 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 60 | 'queue' => env('SQS_QUEUE', 'default'), 61 | 'suffix' => env('SQS_SUFFIX'), 62 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 63 | 'after_commit' => false, 64 | ], 65 | 66 | 'redis' => [ 67 | 'driver' => 'redis', 68 | 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'), 69 | 'queue' => env('REDIS_QUEUE', 'default'), 70 | 'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90), 71 | 'block_for' => null, 72 | 'after_commit' => false, 73 | ], 74 | 75 | ], 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | Job Batching 80 | |-------------------------------------------------------------------------- 81 | | 82 | | The following options configure the database and table that store job 83 | | batching information. These options can be updated to any database 84 | | connection and table which has been defined by your application. 85 | | 86 | */ 87 | 88 | 'batching' => [ 89 | 'database' => env('DB_CONNECTION', 'sqlite'), 90 | 'table' => 'job_batches', 91 | ], 92 | 93 | /* 94 | |-------------------------------------------------------------------------- 95 | | Failed Queue Jobs 96 | |-------------------------------------------------------------------------- 97 | | 98 | | These options configure the behavior of failed queue job logging so you 99 | | can control how and where failed jobs are stored. Laravel ships with 100 | | support for storing failed jobs in a simple file or in a database. 101 | | 102 | | Supported drivers: "database-uuids", "dynamodb", "file", "null" 103 | | 104 | */ 105 | 106 | 'failed' => [ 107 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 108 | 'database' => env('DB_CONNECTION', 'sqlite'), 109 | 'table' => 'failed_jobs', 110 | ], 111 | 112 | ]; 113 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'token' => env('POSTMARK_TOKEN'), 19 | ], 20 | 21 | 'ses' => [ 22 | 'key' => env('AWS_ACCESS_KEY_ID'), 23 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 24 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 25 | ], 26 | 27 | 'resend' => [ 28 | 'key' => env('RESEND_KEY'), 29 | ], 30 | 31 | 'slack' => [ 32 | 'notifications' => [ 33 | 'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'), 34 | 'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'), 35 | ], 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'database'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Session Lifetime 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Here you may specify the number of minutes that you wish the session 29 | | to be allowed to remain idle before it expires. If you want them 30 | | to expire immediately when the browser is closed then you may 31 | | indicate that via the expire_on_close configuration option. 32 | | 33 | */ 34 | 35 | 'lifetime' => env('SESSION_LIFETIME', 120), 36 | 37 | 'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false), 38 | 39 | /* 40 | |-------------------------------------------------------------------------- 41 | | Session Encryption 42 | |-------------------------------------------------------------------------- 43 | | 44 | | This option allows you to easily specify that all of your session data 45 | | should be encrypted before it's stored. All encryption is performed 46 | | automatically by Laravel and you may use the session like normal. 47 | | 48 | */ 49 | 50 | 'encrypt' => env('SESSION_ENCRYPT', false), 51 | 52 | /* 53 | |-------------------------------------------------------------------------- 54 | | Session File Location 55 | |-------------------------------------------------------------------------- 56 | | 57 | | When utilizing the "file" session driver, the session files are placed 58 | | on disk. The default storage location is defined here; however, you 59 | | are free to provide another location where they should be stored. 60 | | 61 | */ 62 | 63 | 'files' => storage_path('framework/sessions'), 64 | 65 | /* 66 | |-------------------------------------------------------------------------- 67 | | Session Database Connection 68 | |-------------------------------------------------------------------------- 69 | | 70 | | When using the "database" or "redis" session drivers, you may specify a 71 | | connection that should be used to manage these sessions. This should 72 | | correspond to a connection in your database configuration options. 73 | | 74 | */ 75 | 76 | 'connection' => env('SESSION_CONNECTION'), 77 | 78 | /* 79 | |-------------------------------------------------------------------------- 80 | | Session Database Table 81 | |-------------------------------------------------------------------------- 82 | | 83 | | When using the "database" session driver, you may specify the table to 84 | | be used to store sessions. Of course, a sensible default is defined 85 | | for you; however, you're welcome to change this to another table. 86 | | 87 | */ 88 | 89 | 'table' => env('SESSION_TABLE', 'sessions'), 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Session Cache Store 94 | |-------------------------------------------------------------------------- 95 | | 96 | | When using one of the framework's cache driven session backends, you may 97 | | define the cache store which should be used to store the session data 98 | | between requests. This must match one of your defined cache stores. 99 | | 100 | | Affects: "apc", "dynamodb", "memcached", "redis" 101 | | 102 | */ 103 | 104 | 'store' => env('SESSION_STORE'), 105 | 106 | /* 107 | |-------------------------------------------------------------------------- 108 | | Session Sweeping Lottery 109 | |-------------------------------------------------------------------------- 110 | | 111 | | Some session drivers must manually sweep their storage location to get 112 | | rid of old sessions from storage. Here are the chances that it will 113 | | happen on a given request. By default, the odds are 2 out of 100. 114 | | 115 | */ 116 | 117 | 'lottery' => [2, 100], 118 | 119 | /* 120 | |-------------------------------------------------------------------------- 121 | | Session Cookie Name 122 | |-------------------------------------------------------------------------- 123 | | 124 | | Here you may change the name of the session cookie that is created by 125 | | the framework. Typically, you should not need to change this value 126 | | since doing so does not grant a meaningful security improvement. 127 | | 128 | */ 129 | 130 | 'cookie' => env( 131 | 'SESSION_COOKIE', 132 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session' 133 | ), 134 | 135 | /* 136 | |-------------------------------------------------------------------------- 137 | | Session Cookie Path 138 | |-------------------------------------------------------------------------- 139 | | 140 | | The session cookie path determines the path for which the cookie will 141 | | be regarded as available. Typically, this will be the root path of 142 | | your application, but you're free to change this when necessary. 143 | | 144 | */ 145 | 146 | 'path' => env('SESSION_PATH', '/'), 147 | 148 | /* 149 | |-------------------------------------------------------------------------- 150 | | Session Cookie Domain 151 | |-------------------------------------------------------------------------- 152 | | 153 | | This value determines the domain and subdomains the session cookie is 154 | | available to. By default, the cookie will be available to the root 155 | | domain and all subdomains. Typically, this shouldn't be changed. 156 | | 157 | */ 158 | 159 | 'domain' => env('SESSION_DOMAIN'), 160 | 161 | /* 162 | |-------------------------------------------------------------------------- 163 | | HTTPS Only Cookies 164 | |-------------------------------------------------------------------------- 165 | | 166 | | By setting this option to true, session cookies will only be sent back 167 | | to the server if the browser has a HTTPS connection. This will keep 168 | | the cookie from being sent to you when it can't be done securely. 169 | | 170 | */ 171 | 172 | 'secure' => env('SESSION_SECURE_COOKIE'), 173 | 174 | /* 175 | |-------------------------------------------------------------------------- 176 | | HTTP Access Only 177 | |-------------------------------------------------------------------------- 178 | | 179 | | Setting this value to true will prevent JavaScript from accessing the 180 | | value of the cookie and the cookie will only be accessible through 181 | | the HTTP protocol. It's unlikely you should disable this option. 182 | | 183 | */ 184 | 185 | 'http_only' => env('SESSION_HTTP_ONLY', true), 186 | 187 | /* 188 | |-------------------------------------------------------------------------- 189 | | Same-Site Cookies 190 | |-------------------------------------------------------------------------- 191 | | 192 | | This option determines how your cookies behave when cross-site requests 193 | | take place, and can be used to mitigate CSRF attacks. By default, we 194 | | will set this value to "lax" to permit secure cross-site requests. 195 | | 196 | | See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value 197 | | 198 | | Supported: "lax", "strict", "none", null 199 | | 200 | */ 201 | 202 | 'same_site' => env('SESSION_SAME_SITE', 'lax'), 203 | 204 | /* 205 | |-------------------------------------------------------------------------- 206 | | Partitioned Cookies 207 | |-------------------------------------------------------------------------- 208 | | 209 | | Setting this value to true will tie the cookie to the top-level site for 210 | | a cross-site context. Partitioned cookies are accepted by the browser 211 | | when flagged "secure" and the Same-Site attribute is set to "none". 212 | | 213 | */ 214 | 215 | 'partitioned' => env('SESSION_PARTITIONED_COOKIE', false), 216 | 217 | ]; 218 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /database/factories/ListingFactory.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | class ListingFactory extends Factory 11 | { 12 | /** 13 | * Define the model's default state. 14 | * 15 | * @return array 16 | */ 17 | public function definition() 18 | { 19 | return [ 20 | 'beds' => fake()->numberBetween(1, 7), 21 | 'baths' => fake()->numberBetween(1, 7), 22 | 'area' => fake()->numberBetween(30, 400), 23 | 'city' => fake()->city(), 24 | 'code' => fake()->postcode(), 25 | 'street' => fake()->streetName(), 26 | 'street_nr' => fake()->numberBetween(10, 200), 27 | 'price' => fake()->numberBetween(50_000, 2_000_000) 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | class UserFactory extends Factory 13 | { 14 | /** 15 | * The current password being used by the factory. 16 | */ 17 | protected static ?string $password; 18 | 19 | /** 20 | * Define the model's default state. 21 | * 22 | * @return array 23 | */ 24 | public function definition(): array 25 | { 26 | return [ 27 | 'name' => fake()->name(), 28 | 'email' => fake()->unique()->safeEmail(), 29 | 'email_verified_at' => now(), 30 | 'password' => static::$password ??= Hash::make('password'), 31 | 'remember_token' => Str::random(10), 32 | ]; 33 | } 34 | 35 | /** 36 | * Indicate that the model's email address should be unverified. 37 | */ 38 | public function unverified(): static 39 | { 40 | return $this->state(fn(array $attributes) => [ 41 | 'email_verified_at' => null, 42 | ]); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /database/migrations/0001_01_01_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('name'); 17 | $table->string('email')->unique(); 18 | $table->timestamp('email_verified_at')->nullable(); 19 | $table->string('password'); 20 | $table->rememberToken(); 21 | $table->timestamps(); 22 | }); 23 | 24 | Schema::create('password_reset_tokens', function (Blueprint $table) { 25 | $table->string('email')->primary(); 26 | $table->string('token'); 27 | $table->timestamp('created_at')->nullable(); 28 | }); 29 | 30 | Schema::create('sessions', function (Blueprint $table) { 31 | $table->string('id')->primary(); 32 | $table->foreignId('user_id')->nullable()->index(); 33 | $table->string('ip_address', 45)->nullable(); 34 | $table->text('user_agent')->nullable(); 35 | $table->longText('payload'); 36 | $table->integer('last_activity')->index(); 37 | }); 38 | } 39 | 40 | /** 41 | * Reverse the migrations. 42 | */ 43 | public function down(): void 44 | { 45 | Schema::dropIfExists('users'); 46 | Schema::dropIfExists('password_reset_tokens'); 47 | Schema::dropIfExists('sessions'); 48 | } 49 | }; 50 | -------------------------------------------------------------------------------- /database/migrations/0001_01_01_000001_create_cache_table.php: -------------------------------------------------------------------------------- 1 | string('key')->primary(); 16 | $table->mediumText('value'); 17 | $table->integer('expiration'); 18 | }); 19 | 20 | Schema::create('cache_locks', function (Blueprint $table) { 21 | $table->string('key')->primary(); 22 | $table->string('owner'); 23 | $table->integer('expiration'); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | */ 30 | public function down(): void 31 | { 32 | Schema::dropIfExists('cache'); 33 | Schema::dropIfExists('cache_locks'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /database/migrations/0001_01_01_000002_create_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 15 | $table->string('queue')->index(); 16 | $table->longText('payload'); 17 | $table->unsignedTinyInteger('attempts'); 18 | $table->unsignedInteger('reserved_at')->nullable(); 19 | $table->unsignedInteger('available_at'); 20 | $table->unsignedInteger('created_at'); 21 | }); 22 | 23 | Schema::create('job_batches', function (Blueprint $table) { 24 | $table->string('id')->primary(); 25 | $table->string('name'); 26 | $table->integer('total_jobs'); 27 | $table->integer('pending_jobs'); 28 | $table->integer('failed_jobs'); 29 | $table->longText('failed_job_ids'); 30 | $table->mediumText('options')->nullable(); 31 | $table->integer('cancelled_at')->nullable(); 32 | $table->integer('created_at'); 33 | $table->integer('finished_at')->nullable(); 34 | }); 35 | 36 | Schema::create('failed_jobs', function (Blueprint $table) { 37 | $table->id(); 38 | $table->string('uuid')->unique(); 39 | $table->text('connection'); 40 | $table->text('queue'); 41 | $table->longText('payload'); 42 | $table->longText('exception'); 43 | $table->timestamp('failed_at')->useCurrent(); 44 | }); 45 | } 46 | 47 | /** 48 | * Reverse the migrations. 49 | */ 50 | public function down(): void 51 | { 52 | Schema::dropIfExists('jobs'); 53 | Schema::dropIfExists('job_batches'); 54 | Schema::dropIfExists('failed_jobs'); 55 | } 56 | }; 57 | -------------------------------------------------------------------------------- /database/migrations/2022_09_23_180153_create_listings_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->timestamps(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::dropIfExists('listings'); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /database/migrations/2022_09_24_150311_add_fields_to_listings_table.php: -------------------------------------------------------------------------------- 1 | unsignedTinyInteger('beds'); 18 | $table->unsignedTinyInteger('baths'); 19 | $table->unsignedSmallInteger('area'); 20 | 21 | $table->tinyText('city'); 22 | $table->tinyText('code'); 23 | $table->tinyText('street'); 24 | $table->tinyText('street_nr'); 25 | 26 | $table->unsignedInteger('price'); 27 | }); 28 | } 29 | 30 | /** 31 | * Reverse the migrations. 32 | * 33 | * @return void 34 | */ 35 | public function down() 36 | { 37 | Schema::dropColumns('listings', [ 38 | 'beds', 'baths', 'area', 'city', 'code', 'street', 'street_nr', 'price' 39 | ]); 40 | } 41 | }; 42 | -------------------------------------------------------------------------------- /database/migrations/2022_10_15_180336_add_by_user_id_column_to_listings_table.php: -------------------------------------------------------------------------------- 1 | foreignIdFor( 18 | \App\Models\User::class, 19 | 'by_user_id' 20 | )->constrained('users'); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::table('listings', function (Blueprint $table) { 32 | // 33 | }); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /database/migrations/2022_10_19_171125_add_is_admin_column_to_users_table.php: -------------------------------------------------------------------------------- 1 | boolean('is_admin')->default(false); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('users', function (Blueprint $table) { 29 | $table->dropColumn('is_admin'); 30 | }); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2022_10_29_152917_add_soft_deletes_to_listings_table.php: -------------------------------------------------------------------------------- 1 | softDeletes(); 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 | $table->dropSoftDeletes(); 30 | }); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2022_11_02_172415_create_listing_images_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->timestamps(); 19 | 20 | $table->string('filename'); 21 | 22 | $table->foreignIdFor( 23 | \App\Models\Listing::class 24 | )->constrained('listings'); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::dropIfExists('listing_images'); 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /database/migrations/2022_11_07_171140_create_offers_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->timestamps(); 19 | 20 | $table->foreignIdFor( 21 | \App\Models\Listing::class, 22 | 'listing_id' 23 | )->constrained('listings'); 24 | $table->foreignIdFor( 25 | \App\Models\User::class, 26 | 'bidder_id' 27 | )->constrained('users'); 28 | 29 | $table->unsignedInteger('amount'); 30 | 31 | $table->timestamp('accepted_at')->nullable(); 32 | $table->timestamp('rejected_at')->nullable(); 33 | }); 34 | } 35 | 36 | /** 37 | * Reverse the migrations. 38 | * 39 | * @return void 40 | */ 41 | public function down() 42 | { 43 | Schema::dropIfExists('offers'); 44 | } 45 | }; 46 | -------------------------------------------------------------------------------- /database/migrations/2022_11_11_155253_add_sold_at_column_to_listings_table.php: -------------------------------------------------------------------------------- 1 | timestamp('sold_at')->nullable(); 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 | $table->dropColumn('sold_at'); 30 | }); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2022_11_13_174432_create_notifications_table.php: -------------------------------------------------------------------------------- 1 | uuid('id')->primary(); 18 | $table->string('type'); 19 | $table->morphs('notifiable'); 20 | $table->text('data'); 21 | $table->timestamp('read_at')->nullable(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('notifications'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 18 | 19 | User::factory()->create([ 20 | 'name' => 'Test User', 21 | 'email' => 'test@example.com', 22 | ]); 23 | User::factory()->create([ 24 | 'name' => 'Test User', 25 | 'email' => 'test2@example.com', 26 | ]); 27 | Listing::factory(10)->create([ 28 | 'by_user_id' => 1 29 | ]); 30 | Listing::factory(10)->create([ 31 | 'by_user_id' => 2 32 | ]); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.9" 2 | services: 3 | mysql: 4 | image: mariadb:10.8.3 5 | # Uncomment below when on Mac M1 6 | platform: linux/arm64/v8 7 | command: --default-authentication-plugin=mysql_native_password 8 | restart: always 9 | environment: 10 | MYSQL_ROOT_PASSWORD: root 11 | ports: 12 | - 3306:3306 13 | adminer: 14 | image: adminer 15 | restart: always 16 | ports: 17 | - 8080:8080 18 | mailhog: 19 | image: mailhog/mailhog 20 | ports: 21 | - 1025:1025 22 | - 8025:8025 23 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "paths": { 5 | "@/*": [ 6 | "resources/js/*" 7 | ] 8 | }, 9 | "jsx": "preserve", 10 | }, 11 | "exclude": [ 12 | "node_modules", 13 | "public" 14 | ] 15 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lang/en/validation.php: -------------------------------------------------------------------------------- 1 | 'The :attribute must be accepted.', 17 | 'accepted_if' => 'The :attribute must be accepted when :other is :value.', 18 | 'active_url' => 'The :attribute is not a valid URL.', 19 | 'after' => 'The :attribute must be a date after :date.', 20 | 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', 21 | 'alpha' => 'The :attribute must only contain letters.', 22 | 'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.', 23 | 'alpha_num' => 'The :attribute must only contain letters and numbers.', 24 | 'array' => 'The :attribute must be an array.', 25 | 'before' => 'The :attribute must be a date before :date.', 26 | 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', 27 | 'between' => [ 28 | 'array' => 'The :attribute must have between :min and :max items.', 29 | 'file' => 'The :attribute must be between :min and :max kilobytes.', 30 | 'numeric' => 'The :attribute must be between :min and :max.', 31 | 'string' => 'The :attribute must be between :min and :max characters.', 32 | ], 33 | 'boolean' => 'The :attribute field must be true or false.', 34 | 'confirmed' => 'The :attribute confirmation does not match.', 35 | 'current_password' => 'The password is incorrect.', 36 | 'date' => 'The :attribute is not a valid date.', 37 | 'date_equals' => 'The :attribute must be a date equal to :date.', 38 | 'date_format' => 'The :attribute does not match the format :format.', 39 | 'declined' => 'The :attribute must be declined.', 40 | 'declined_if' => 'The :attribute must be declined when :other is :value.', 41 | 'different' => 'The :attribute and :other must be different.', 42 | 'digits' => 'The :attribute must be :digits digits.', 43 | 'digits_between' => 'The :attribute must be between :min and :max digits.', 44 | 'dimensions' => 'The :attribute has invalid image dimensions.', 45 | 'distinct' => 'The :attribute field has a duplicate value.', 46 | 'doesnt_end_with' => 'The :attribute may not end with one of the following: :values.', 47 | 'doesnt_start_with' => 'The :attribute may not start with one of the following: :values.', 48 | 'email' => 'The :attribute must be a valid email address.', 49 | 'ends_with' => 'The :attribute must end with one of the following: :values.', 50 | 'enum' => 'The selected :attribute is invalid.', 51 | 'exists' => 'The selected :attribute is invalid.', 52 | 'file' => 'The :attribute must be a file.', 53 | 'filled' => 'The :attribute field must have a value.', 54 | 'gt' => [ 55 | 'array' => 'The :attribute must have more than :value items.', 56 | 'file' => 'The :attribute must be greater than :value kilobytes.', 57 | 'numeric' => 'The :attribute must be greater than :value.', 58 | 'string' => 'The :attribute must be greater than :value characters.', 59 | ], 60 | 'gte' => [ 61 | 'array' => 'The :attribute must have :value items or more.', 62 | 'file' => 'The :attribute must be greater than or equal to :value kilobytes.', 63 | 'numeric' => 'The :attribute must be greater than or equal to :value.', 64 | 'string' => 'The :attribute must be greater than or equal to :value characters.', 65 | ], 66 | 'image' => 'The :attribute must be an image.', 67 | 'in' => 'The selected :attribute is invalid.', 68 | 'in_array' => 'The :attribute field does not exist in :other.', 69 | 'integer' => 'The :attribute must be an integer.', 70 | 'ip' => 'The :attribute must be a valid IP address.', 71 | 'ipv4' => 'The :attribute must be a valid IPv4 address.', 72 | 'ipv6' => 'The :attribute must be a valid IPv6 address.', 73 | 'json' => 'The :attribute must be a valid JSON string.', 74 | 'lt' => [ 75 | 'array' => 'The :attribute must have less than :value items.', 76 | 'file' => 'The :attribute must be less than :value kilobytes.', 77 | 'numeric' => 'The :attribute must be less than :value.', 78 | 'string' => 'The :attribute must be less than :value characters.', 79 | ], 80 | 'lte' => [ 81 | 'array' => 'The :attribute must not have more than :value items.', 82 | 'file' => 'The :attribute must be less than or equal to :value kilobytes.', 83 | 'numeric' => 'The :attribute must be less than or equal to :value.', 84 | 'string' => 'The :attribute must be less than or equal to :value characters.', 85 | ], 86 | 'mac_address' => 'The :attribute must be a valid MAC address.', 87 | 'max' => [ 88 | 'array' => 'The :attribute must not have more than :max items.', 89 | 'file' => 'The :attribute must not be greater than :max kilobytes.', 90 | 'numeric' => 'The :attribute must not be greater than :max.', 91 | 'string' => 'The :attribute must not be greater than :max characters.', 92 | ], 93 | 'max_digits' => 'The :attribute must not have more than :max digits.', 94 | 'mimes' => 'The :attribute must be a file of type: :values.', 95 | 'mimetypes' => 'The :attribute must be a file of type: :values.', 96 | 'min' => [ 97 | 'array' => 'The :attribute must have at least :min items.', 98 | 'file' => 'The :attribute must be at least :min kilobytes.', 99 | 'numeric' => 'The :attribute must be at least :min.', 100 | 'string' => 'The :attribute must be at least :min characters.', 101 | ], 102 | 'min_digits' => 'The :attribute must have at least :min digits.', 103 | 'multiple_of' => 'The :attribute must be a multiple of :value.', 104 | 'not_in' => 'The selected :attribute is invalid.', 105 | 'not_regex' => 'The :attribute format is invalid.', 106 | 'numeric' => 'The :attribute must be a number.', 107 | 'password' => [ 108 | 'letters' => 'The :attribute must contain at least one letter.', 109 | 'mixed' => 'The :attribute must contain at least one uppercase and one lowercase letter.', 110 | 'numbers' => 'The :attribute must contain at least one number.', 111 | 'symbols' => 'The :attribute must contain at least one symbol.', 112 | 'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.', 113 | ], 114 | 'present' => 'The :attribute field must be present.', 115 | 'prohibited' => 'The :attribute field is prohibited.', 116 | 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.', 117 | 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.', 118 | 'prohibits' => 'The :attribute field prohibits :other from being present.', 119 | 'regex' => 'The :attribute format is invalid.', 120 | 'required' => 'The :attribute field is required.', 121 | 'required_array_keys' => 'The :attribute field must contain entries for: :values.', 122 | 'required_if' => 'The :attribute field is required when :other is :value.', 123 | 'required_unless' => 'The :attribute field is required unless :other is in :values.', 124 | 'required_with' => 'The :attribute field is required when :values is present.', 125 | 'required_with_all' => 'The :attribute field is required when :values are present.', 126 | 'required_without' => 'The :attribute field is required when :values is not present.', 127 | 'required_without_all' => 'The :attribute field is required when none of :values are present.', 128 | 'same' => 'The :attribute and :other must match.', 129 | 'size' => [ 130 | 'array' => 'The :attribute must contain :size items.', 131 | 'file' => 'The :attribute must be :size kilobytes.', 132 | 'numeric' => 'The :attribute must be :size.', 133 | 'string' => 'The :attribute must be :size characters.', 134 | ], 135 | 'starts_with' => 'The :attribute must start with one of the following: :values.', 136 | 'string' => 'The :attribute must be a string.', 137 | 'timezone' => 'The :attribute must be a valid timezone.', 138 | 'unique' => 'The :attribute has already been taken.', 139 | 'uploaded' => 'The :attribute failed to upload.', 140 | 'url' => 'The :attribute must be a valid URL.', 141 | 'uuid' => 'The :attribute must be a valid UUID.', 142 | 143 | /* 144 | |-------------------------------------------------------------------------- 145 | | Custom Validation Language Lines 146 | |-------------------------------------------------------------------------- 147 | | 148 | | Here you may specify custom validation messages for attributes using the 149 | | convention "attribute.rule" to name the lines. This makes it quick to 150 | | specify a specific custom language line for a given attribute rule. 151 | | 152 | */ 153 | 154 | 'custom' => [ 155 | 'attribute-name' => [ 156 | 'rule-name' => 'custom-message', 157 | ], 158 | ], 159 | 160 | /* 161 | |-------------------------------------------------------------------------- 162 | | Custom Validation Attributes 163 | |-------------------------------------------------------------------------- 164 | | 165 | | The following language lines are used to swap our attribute placeholder 166 | | with something more reader friendly such as "E-Mail Address" instead 167 | | of "email". This simply helps us make our message more expressive. 168 | | 169 | */ 170 | 171 | 'attributes' => [], 172 | 173 | ]; 174 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "type": "module", 4 | "scripts": { 5 | "build": "vite build", 6 | "dev": "vite" 7 | }, 8 | "devDependencies": { 9 | "@tailwindcss/forms": "^0.5.9", 10 | "autoprefixer": "^10.4.20", 11 | "axios": "^1.7.4", 12 | "concurrently": "^9.0.1", 13 | "laravel-vite-plugin": "^1.0", 14 | "postcss": "^8.4.47", 15 | "tailwindcss": "^3.4.14", 16 | "vite": "^5.0" 17 | }, 18 | "dependencies": { 19 | "@inertiajs/vue3": "^1.2.0", 20 | "@vitejs/plugin-vue": "^5.1.4", 21 | "vue": "^3.5.12" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /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 | 33 | 34 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /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/piotr-jura-udemy/master-laravel-vue-fullstack/296e750dad1fde48110ddbd025829e875d790373/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | handleRequest(Request::capture()); 18 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /resources/css/app.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | @layer components { 6 | .label { 7 | @apply block mb-1 text-gray-500 dark:text-gray-300 font-medium; 8 | } 9 | 10 | .input { 11 | @apply block w-full p-2 rounded-md shadow-sm border border-gray-300 dark:border-gray-600 text-gray-500; 12 | } 13 | 14 | .input-error { 15 | @apply text-sm text-red-500 dark:text-red-400; 16 | } 17 | 18 | .input-filter-l { 19 | @apply placeholder:text-gray-400 dark:placeholder:text-gray-600 border border-gray-200 dark:border-gray-700 rounded-t-md rounded-l-md rounded-b-md rounded-r-none text-sm font-medium text-gray-600 dark:text-gray-400 dark:bg-gray-800; 20 | } 21 | 22 | .input-filter-r { 23 | @apply placeholder:text-gray-400 dark:placeholder:text-gray-600 border border-l-0 border-gray-200 dark:border-gray-700 rounded-t-md rounded-l-none rounded-b-none rounded-r-md text-sm font-medium text-gray-600 dark:text-gray-400 dark:bg-gray-800; 24 | } 25 | 26 | .btn-normal { 27 | @apply bg-gray-600 hover:bg-gray-500 text-white font-medium p-2 rounded-md; 28 | } 29 | 30 | .btn-primary { 31 | @apply bg-indigo-600 hover:bg-indigo-500 text-white font-medium p-2 rounded-md; 32 | } 33 | 34 | .btn-outline { 35 | @apply p-2 rounded-md border shadow-sm border-gray-300 dark:border-gray-800 hover:border-gray-400 hover:bg-gray-50 dark:hover:border-gray-700 dark:hover:bg-gray-800; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /resources/js/Components/ListingAddress.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | -------------------------------------------------------------------------------- /resources/js/Components/ListingSpace.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /resources/js/Components/Price.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /resources/js/Components/UI/Box.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/js/Components/UI/EmptyState.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | -------------------------------------------------------------------------------- /resources/js/Components/UI/Pagination.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /resources/js/Composables/useMonthlyPayment.js: -------------------------------------------------------------------------------- 1 | import { computed, isRef } from 'vue' 2 | 3 | export const useMonthlyPayment = (total, interestRate, duration) => { 4 | const monthlyPayment = computed(() => { 5 | const principle = isRef(total) ? total.value : total 6 | const monthlyInterest = (isRef(interestRate) ? interestRate.value : interestRate) / 100 / 12 7 | const numberOfPaymentMonths = (isRef(duration) ? duration.value : duration) * 12 8 | 9 | return principle * monthlyInterest * (Math.pow(1 + monthlyInterest, numberOfPaymentMonths)) / (Math.pow(1 + monthlyInterest, numberOfPaymentMonths) - 1) 10 | }) 11 | 12 | const totalPaid = computed(() => { 13 | return (isRef(duration) ? duration.value : duration) * 12 * monthlyPayment.value 14 | }) 15 | 16 | const totalInterest = computed(() => totalPaid.value - (isRef(total) ? total.value : total)) 17 | 18 | return { monthlyPayment, totalPaid, totalInterest } 19 | } -------------------------------------------------------------------------------- /resources/js/Layouts/MainLayout.vue: -------------------------------------------------------------------------------- 1 | 43 | 44 | -------------------------------------------------------------------------------- /resources/js/Pages/Auth/Login.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | -------------------------------------------------------------------------------- /resources/js/Pages/Auth/VerifyEmail.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/js/Pages/Index/Index.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /resources/js/Pages/Index/Show.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /resources/js/Pages/Listing/Index.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | -------------------------------------------------------------------------------- /resources/js/Pages/Listing/Index/Components/Filters.vue: -------------------------------------------------------------------------------- 1 | 48 | 49 | -------------------------------------------------------------------------------- /resources/js/Pages/Listing/Index/Components/Listing.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | -------------------------------------------------------------------------------- /resources/js/Pages/Listing/Show.vue: -------------------------------------------------------------------------------- 1 | 80 | 81 | -------------------------------------------------------------------------------- /resources/js/Pages/Listing/Show/Components/MakeOffer.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | -------------------------------------------------------------------------------- /resources/js/Pages/Listing/Show/Components/OfferMade.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | -------------------------------------------------------------------------------- /resources/js/Pages/Notification/Index.vue: -------------------------------------------------------------------------------- 1 | 38 | 39 | -------------------------------------------------------------------------------- /resources/js/Pages/Realtor/Create.vue: -------------------------------------------------------------------------------- 1 | 74 | 75 | -------------------------------------------------------------------------------- /resources/js/Pages/Realtor/Edit.vue: -------------------------------------------------------------------------------- 1 | 74 | 75 | -------------------------------------------------------------------------------- /resources/js/Pages/Realtor/Index.vue: -------------------------------------------------------------------------------- 1 | 88 | 89 | 104 | -------------------------------------------------------------------------------- /resources/js/Pages/Realtor/Index/Components/RealtorFilters.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | -------------------------------------------------------------------------------- /resources/js/Pages/Realtor/ListingImage/Create.vue: -------------------------------------------------------------------------------- 1 | 52 | 53 | -------------------------------------------------------------------------------- /resources/js/Pages/Realtor/Show.vue: -------------------------------------------------------------------------------- 1 | 44 | 45 | -------------------------------------------------------------------------------- /resources/js/Pages/Realtor/Show/Components/Offer.vue: -------------------------------------------------------------------------------- 1 | 34 | 35 | -------------------------------------------------------------------------------- /resources/js/Pages/UserAccount/Create.vue: -------------------------------------------------------------------------------- 1 | 66 | 67 | -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | import { createApp, h } from 'vue' 2 | import { createInertiaApp } from '@inertiajs/vue3' 3 | import '../css/app.css' 4 | import MainLayout from './Layouts/MainLayout.vue' 5 | import { ZiggyVue } from 'ziggy-js'; 6 | 7 | 8 | createInertiaApp({ 9 | resolve: name => { 10 | const pages = import.meta.glob('./Pages/**/*.vue', { eager: true }) 11 | let page = pages[`./Pages/${name}.vue`] 12 | page.default.layout = page.default.layout || MainLayout 13 | return page 14 | }, 15 | setup({ el, App, props, plugin }) { 16 | createApp({ render: () => h(App, props) }) 17 | .use(plugin) 18 | .use(ZiggyVue) 19 | .mount(el) 20 | }, 21 | }) -------------------------------------------------------------------------------- /resources/views/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Larazillow 9 | 11 | 12 | @routes 13 | @vite('resources/js/app.js') 14 | @inertiaHead 15 | 16 | 17 | 18 | @inertia 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 8 | })->purpose('Display an inspiring quote')->hourly(); 9 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 19 | 20 | Route::resource('listing', ListingController::class) 21 | ->only(['index', 'show']); 22 | 23 | Route::resource('listing.offer', ListingOfferController::class) 24 | ->middleware('auth') 25 | ->only(['store']); 26 | 27 | Route::resource('notification', NotificationController::class) 28 | ->middleware('auth') 29 | ->only(['index']); 30 | 31 | Route::put( 32 | 'notification/{notification}/seen', 33 | NotificationSeenController::class 34 | )->middleware('auth')->name('notification.seen'); 35 | 36 | Route::get('login', [AuthController::class, 'create']) 37 | ->name('login'); 38 | Route::post('login', [AuthController::class, 'store']) 39 | ->name('login.store'); 40 | Route::delete('logout', [AuthController::class, 'destroy']) 41 | ->name('logout'); 42 | 43 | Route::get('/email/verify', function () { 44 | return inertia('Auth/VerifyEmail'); 45 | }) 46 | ->middleware('auth')->name('verification.notice'); 47 | 48 | Route::get('/email/verify/{id}/{hash}', function (EmailVerificationRequest $request) { 49 | $request->fulfill(); 50 | 51 | return redirect()->route('listing.index') 52 | ->with('success', 'Email was verified!'); 53 | })->middleware(['auth', 'signed'])->name('verification.verify'); 54 | 55 | Route::post('/email/verification-notification', function (Request $request) { 56 | $request->user()->sendEmailVerificationNotification(); 57 | 58 | return back()->with('success', 'Verification link sent!'); 59 | })->middleware(['auth', 'throttle:6,1'])->name('verification.send'); 60 | 61 | Route::resource('user-account', UserAccountController::class) 62 | ->only(['create', 'store']); 63 | 64 | Route::prefix('realtor') 65 | ->name('realtor.') 66 | ->middleware(['auth', 'verified']) 67 | ->group(function () { 68 | Route::name('listing.restore') 69 | ->put( 70 | 'listing/{listing}/restore', 71 | [RealtorListingController::class, 'restore'] 72 | )->withTrashed(); 73 | Route::resource('listing', RealtorListingController::class) 74 | // ->only(['index', 'destroy', 'edit', 'update', 'create', 'store']) 75 | ->withTrashed(); 76 | 77 | Route::name('offer.accept') 78 | ->put( 79 | 'offer/{offer}/accept', 80 | RealtorListingAcceptOfferController::class 81 | ); 82 | 83 | Route::resource('listing.image', RealtorListingImageController::class) 84 | ->only(['create', 'store', 'destroy']); 85 | }); -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !private/ 3 | !public/ 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /storage/app/private/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /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 | import defaultTheme from 'tailwindcss/defaultTheme'; 2 | 3 | /** @type {import('tailwindcss').Config} */ 4 | export default { 5 | content: [ 6 | './vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php', 7 | './storage/framework/views/*.php', 8 | './resources/**/*.blade.php', 9 | './resources/**/*.js', 10 | './resources/**/*.vue', 11 | ], 12 | theme: { 13 | extend: { 14 | fontFamily: { 15 | sans: ['Figtree', ...defaultTheme.fontFamily.sans], 16 | }, 17 | }, 18 | }, 19 | plugins: [ 20 | require('@tailwindcss/forms'), 21 | ], 22 | }; 23 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 16 | 17 | $response->assertStatus(200); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | import vue from '@vitejs/plugin-vue'; 4 | import path from 'path'; 5 | 6 | export default defineConfig({ 7 | plugins: [ 8 | laravel({ 9 | input: ['resources/css/app.css', 'resources/js/app.js'], 10 | refresh: true, 11 | }), 12 | vue(), 13 | ], 14 | resolve: { 15 | alias: { 16 | 'ziggy-js': path.resolve('vendor/tightenco/ziggy'), 17 | }, 18 | }, 19 | }); 20 | --------------------------------------------------------------------------------