├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── README.md ├── app ├── Console │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── AttendingEventController.php │ │ ├── AttentingSystemController.php │ │ ├── Auth │ │ │ ├── AuthenticatedSessionController.php │ │ │ ├── ConfirmablePasswordController.php │ │ │ ├── EmailVerificationNotificationController.php │ │ │ ├── EmailVerificationPromptController.php │ │ │ ├── NewPasswordController.php │ │ │ ├── PasswordController.php │ │ │ ├── PasswordResetLinkController.php │ │ │ ├── RegisteredUserController.php │ │ │ └── VerifyEmailController.php │ │ ├── Controller.php │ │ ├── DeleteCommentController.php │ │ ├── EventController.php │ │ ├── EventIndexController.php │ │ ├── EventShowController.php │ │ ├── GalleryController.php │ │ ├── GalleryIndexController.php │ │ ├── LikeSystemController.php │ │ ├── LikedEventController.php │ │ ├── ProfileController.php │ │ ├── SavedEventController.php │ │ ├── SavedEventSystemController.php │ │ ├── StoreCommentController.php │ │ └── WelcomeController.php │ ├── Kernel.php │ ├── Middleware │ │ ├── Authenticate.php │ │ ├── EncryptCookies.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustHosts.php │ │ ├── TrustProxies.php │ │ ├── ValidateSignature.php │ │ └── VerifyCsrfToken.php │ └── Requests │ │ ├── Auth │ │ └── LoginRequest.php │ │ ├── CreateEventRequest.php │ │ ├── ProfileUpdateRequest.php │ │ └── UpdateEventRequest.php ├── Models │ ├── Attending.php │ ├── City.php │ ├── Comment.php │ ├── Country.php │ ├── Event.php │ ├── Gallery.php │ ├── Like.php │ ├── SavedEvent.php │ ├── Tag.php │ └── User.php ├── Policies │ └── CommentPolicy.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php └── View │ └── Components │ ├── AppLayout.php │ ├── GuestLayout.php │ └── MainLayout.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── cors.php ├── database.php ├── filesystems.php ├── hashing.php ├── logging.php ├── mail.php ├── queue.php ├── sanctum.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_reset_tokens_table.php │ ├── 2019_08_19_000000_create_failed_jobs_table.php │ ├── 2019_12_14_000001_create_personal_access_tokens_table.php │ ├── 2023_07_13_072809_create_countries_table.php │ ├── 2023_07_13_072815_create_cities_table.php │ ├── 2023_07_13_072824_create_events_table.php │ ├── 2023_07_13_072839_create_attendings_table.php │ ├── 2023_07_13_072853_create_comments_table.php │ ├── 2023_07_13_072901_create_gelleries_table.php │ ├── 2023_07_13_072910_create_likes_table.php │ ├── 2023_07_13_072919_create_saved_events_table.php │ ├── 2023_07_13_072926_create_tags_table.php │ └── 2023_07_19_075701_create_event_tag_table.php └── seeders │ └── DatabaseSeeder.php ├── package-lock.json ├── package.json ├── phpunit.xml ├── postcss.config.js ├── public ├── .htaccess ├── favicon.ico ├── index.php └── robots.txt ├── resources ├── css │ └── app.css ├── js │ ├── app.js │ └── bootstrap.js └── views │ ├── auth │ ├── confirm-password.blade.php │ ├── forgot-password.blade.php │ ├── login.blade.php │ ├── register.blade.php │ ├── reset-password.blade.php │ └── verify-email.blade.php │ ├── components │ ├── application-logo.blade.php │ ├── auth-session-status.blade.php │ ├── danger-button.blade.php │ ├── dropdown-link.blade.php │ ├── dropdown.blade.php │ ├── input-error.blade.php │ ├── input-label.blade.php │ ├── modal.blade.php │ ├── nav-link.blade.php │ ├── primary-button.blade.php │ ├── responsive-nav-link.blade.php │ ├── secondary-button.blade.php │ └── text-input.blade.php │ ├── dashboard.blade.php │ ├── eventIndex.blade.php │ ├── events │ ├── attendingEvents.blade.php │ ├── create.blade.php │ ├── edit.blade.php │ ├── index.blade.php │ ├── likedEvents.blade.php │ └── savedEvents.blade.php │ ├── eventsShow.blade.php │ ├── galleries │ ├── create.blade.php │ ├── edit.blade.php │ └── index.blade.php │ ├── galleryIndex.blade.php │ ├── layouts │ ├── app.blade.php │ ├── guest.blade.php │ ├── main-navigation.blade.php │ ├── main.blade.php │ └── navigation.blade.php │ ├── profile │ ├── edit.blade.php │ └── partials │ │ ├── delete-user-form.blade.php │ │ ├── update-password-form.blade.php │ │ └── update-profile-information-form.blade.php │ └── welcome.blade.php ├── routes ├── api.php ├── auth.php ├── channels.php ├── console.php └── web.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tailwind.config.js ├── tests ├── CreatesApplication.php ├── Feature │ ├── Auth │ │ ├── AuthenticationTest.php │ │ ├── EmailVerificationTest.php │ │ ├── PasswordConfirmationTest.php │ │ ├── PasswordResetTest.php │ │ ├── PasswordUpdateTest.php │ │ └── RegistrationTest.php │ ├── ExampleTest.php │ └── ProfileTest.php ├── Pest.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 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 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=event 15 | DB_USERNAME=root 16 | DB_PASSWORD=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=mailpit 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_APP_NAME="${APP_NAME}" 55 | VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 56 | VITE_PUSHER_HOST="${PUSHER_HOST}" 57 | VITE_PUSHER_PORT="${PUSHER_PORT}" 58 | VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" 59 | VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 60 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 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 | /.phpunit.cache 2 | /node_modules 3 | /public/build 4 | /public/hot 5 | /public/storage 6 | /storage/*.key 7 | /vendor 8 | .env 9 | .env.backup 10 | .env.production 11 | .phpunit.result.cache 12 | Homestead.json 13 | Homestead.yaml 14 | auth.json 15 | npm-debug.log 16 | yarn-error.log 17 | /.fleet 18 | /.idea 19 | /.vscode 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | 9 | 10 | ## About Laravel 11 | 12 | Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: 13 | 14 | - [Simple, fast routing engine](https://laravel.com/docs/routing). 15 | - [Powerful dependency injection container](https://laravel.com/docs/container). 16 | - Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. 17 | - Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). 18 | - Database agnostic [schema migrations](https://laravel.com/docs/migrations). 19 | - [Robust background job processing](https://laravel.com/docs/queues). 20 | - [Real-time event broadcasting](https://laravel.com/docs/broadcasting). 21 | 22 | Laravel is accessible, powerful, and provides tools required for large, robust applications. 23 | 24 | ## Learning Laravel 25 | 26 | Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. 27 | 28 | You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch. 29 | 30 | If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. 31 | 32 | ## Laravel Sponsors 33 | 34 | We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell). 35 | 36 | ### Premium Partners 37 | 38 | - **[Vehikl](https://vehikl.com/)** 39 | - **[Tighten Co.](https://tighten.co)** 40 | - **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** 41 | - **[64 Robots](https://64robots.com)** 42 | - **[Cubet Techno Labs](https://cubettech.com)** 43 | - **[Cyber-Duck](https://cyber-duck.co.uk)** 44 | - **[Many](https://www.many.co.uk)** 45 | - **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)** 46 | - **[DevSquad](https://devsquad.com)** 47 | - **[Curotec](https://www.curotec.com/services/technologies/laravel/)** 48 | - **[OP.GG](https://op.gg)** 49 | - **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)** 50 | - **[Lendio](https://lendio.com)** 51 | 52 | ## Contributing 53 | 54 | Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). 55 | 56 | ## Code of Conduct 57 | 58 | In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). 59 | 60 | ## Security Vulnerabilities 61 | 62 | If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. 63 | 64 | ## License 65 | 66 | The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). 67 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 16 | } 17 | 18 | /** 19 | * Register the commands for the application. 20 | */ 21 | protected function commands(): void 22 | { 23 | $this->load(__DIR__.'/Commands'); 24 | 25 | require base_path('routes/console.php'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | protected $dontFlash = [ 16 | 'current_password', 17 | 'password', 18 | 'password_confirmation', 19 | ]; 20 | 21 | /** 22 | * Register the exception handling callbacks for the application. 23 | */ 24 | public function register(): void 25 | { 26 | $this->reportable(function (Throwable $e) { 27 | // 28 | }); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Controllers/AttendingEventController.php: -------------------------------------------------------------------------------- 1 | whereHas('attendings', function ($q) { 15 | $q->where('user_id', auth()->id()); 16 | })->get(); 17 | 18 | return view('events.attendingEvents', compact('events')); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Controllers/AttentingSystemController.php: -------------------------------------------------------------------------------- 1 | attendings()->where('user_id', auth()->id())->first(); 17 | if (!is_null($attending)) { 18 | $attending->delete(); 19 | return null; 20 | } else { 21 | $attending = $event->attendings()->create([ 22 | 'user_id' => auth()->id(), 23 | 'num_tickets' => 1 24 | ]); 25 | return $attending; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/AuthenticatedSessionController.php: -------------------------------------------------------------------------------- 1 | authenticate(); 29 | 30 | $request->session()->regenerate(); 31 | 32 | return redirect()->intended(RouteServiceProvider::HOME); 33 | } 34 | 35 | /** 36 | * Destroy an authenticated session. 37 | */ 38 | public function destroy(Request $request): RedirectResponse 39 | { 40 | Auth::guard('web')->logout(); 41 | 42 | $request->session()->invalidate(); 43 | 44 | $request->session()->regenerateToken(); 45 | 46 | return redirect('/'); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ConfirmablePasswordController.php: -------------------------------------------------------------------------------- 1 | validate([ 29 | 'email' => $request->user()->email, 30 | 'password' => $request->password, 31 | ])) { 32 | throw ValidationException::withMessages([ 33 | 'password' => __('auth.password'), 34 | ]); 35 | } 36 | 37 | $request->session()->put('auth.password_confirmed_at', time()); 38 | 39 | return redirect()->intended(RouteServiceProvider::HOME); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/EmailVerificationNotificationController.php: -------------------------------------------------------------------------------- 1 | user()->hasVerifiedEmail()) { 18 | return redirect()->intended(RouteServiceProvider::HOME); 19 | } 20 | 21 | $request->user()->sendEmailVerificationNotification(); 22 | 23 | return back()->with('status', 'verification-link-sent'); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/EmailVerificationPromptController.php: -------------------------------------------------------------------------------- 1 | user()->hasVerifiedEmail() 19 | ? redirect()->intended(RouteServiceProvider::HOME) 20 | : view('auth.verify-email'); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/NewPasswordController.php: -------------------------------------------------------------------------------- 1 | $request]); 23 | } 24 | 25 | /** 26 | * Handle an incoming new password request. 27 | * 28 | * @throws \Illuminate\Validation\ValidationException 29 | */ 30 | public function store(Request $request): RedirectResponse 31 | { 32 | $request->validate([ 33 | 'token' => ['required'], 34 | 'email' => ['required', 'email'], 35 | 'password' => ['required', 'confirmed', Rules\Password::defaults()], 36 | ]); 37 | 38 | // Here we will attempt to reset the user's password. If it is successful we 39 | // will update the password on an actual user model and persist it to the 40 | // database. Otherwise we will parse the error and return the response. 41 | $status = Password::reset( 42 | $request->only('email', 'password', 'password_confirmation', 'token'), 43 | function ($user) use ($request) { 44 | $user->forceFill([ 45 | 'password' => Hash::make($request->password), 46 | 'remember_token' => Str::random(60), 47 | ])->save(); 48 | 49 | event(new PasswordReset($user)); 50 | } 51 | ); 52 | 53 | // If the password was successfully reset, we will redirect the user back to 54 | // the application's home authenticated view. If there is an error we can 55 | // redirect them back to where they came from with their error message. 56 | return $status == Password::PASSWORD_RESET 57 | ? redirect()->route('login')->with('status', __($status)) 58 | : back()->withInput($request->only('email')) 59 | ->withErrors(['email' => __($status)]); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/PasswordController.php: -------------------------------------------------------------------------------- 1 | validateWithBag('updatePassword', [ 19 | 'current_password' => ['required', 'current_password'], 20 | 'password' => ['required', Password::defaults(), 'confirmed'], 21 | ]); 22 | 23 | $request->user()->update([ 24 | 'password' => Hash::make($validated['password']), 25 | ]); 26 | 27 | return back()->with('status', 'password-updated'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/PasswordResetLinkController.php: -------------------------------------------------------------------------------- 1 | validate([ 29 | 'email' => ['required', 'email'], 30 | ]); 31 | 32 | // We will send the password reset link to this user. Once we have attempted 33 | // to send the link, we will examine the response then see the message we 34 | // need to show to the user. Finally, we'll send out a proper response. 35 | $status = Password::sendResetLink( 36 | $request->only('email') 37 | ); 38 | 39 | return $status == Password::RESET_LINK_SENT 40 | ? back()->with('status', __($status)) 41 | : back()->withInput($request->only('email')) 42 | ->withErrors(['email' => __($status)]); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisteredUserController.php: -------------------------------------------------------------------------------- 1 | validate([ 34 | 'name' => ['required', 'string', 'max:255'], 35 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:'.User::class], 36 | 'password' => ['required', 'confirmed', Rules\Password::defaults()], 37 | ]); 38 | 39 | $user = User::create([ 40 | 'name' => $request->name, 41 | 'email' => $request->email, 42 | 'password' => Hash::make($request->password), 43 | ]); 44 | 45 | event(new Registered($user)); 46 | 47 | Auth::login($user); 48 | 49 | return redirect(RouteServiceProvider::HOME); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/VerifyEmailController.php: -------------------------------------------------------------------------------- 1 | user()->hasVerifiedEmail()) { 19 | return redirect()->intended(RouteServiceProvider::HOME.'?verified=1'); 20 | } 21 | 22 | if ($request->user()->markEmailAsVerified()) { 23 | event(new Verified($request->user())); 24 | } 25 | 26 | return redirect()->intended(RouteServiceProvider::HOME.'?verified=1'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | authorize('delete', $comment); 16 | $comment->delete(); 17 | 18 | return back(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Controllers/EventController.php: -------------------------------------------------------------------------------- 1 | get(); 24 | return view('events.index', compact('events')); 25 | } 26 | 27 | /** 28 | * Show the form for creating a new resource. 29 | */ 30 | public function create(): View 31 | { 32 | $countries = Country::all(); 33 | $tags = Tag::all(); 34 | return view('events.create', compact('countries', 'tags')); 35 | } 36 | 37 | /** 38 | * Store a newly created resource in storage. 39 | */ 40 | public function store(CreateEventRequest $request): RedirectResponse 41 | { 42 | if ($request->hasFile('image')) { 43 | 44 | $data = $request->validated(); 45 | $data['image'] = Storage::putFile('events', $request->file('image')); 46 | $data['user_id'] = auth()->id(); 47 | $data['slug'] = Str::slug($request->title); 48 | 49 | $event = Event::create($data); 50 | $event->tags()->attach($request->tags); 51 | return to_route('events.index'); 52 | } else { 53 | return back(); 54 | } 55 | } 56 | 57 | 58 | /** 59 | * Show the form for editing the specified resource. 60 | */ 61 | public function edit(Event $event): View 62 | { 63 | $countries = Country::all(); 64 | $tags = Tag::all(); 65 | return view('events.edit', compact('countries', 'tags', 'event')); 66 | } 67 | 68 | /** 69 | * Update the specified resource in storage. 70 | */ 71 | public function update(UpdateEventRequest $request, Event $event): RedirectResponse 72 | { 73 | $data = $request->validated(); 74 | if ($request->hasFile('image')) { 75 | Storage::delete($event->image); 76 | $data['image'] = Storage::putFile('events', $request->file('image')); 77 | } 78 | 79 | $data['slug'] = Str::slug($request->title); 80 | $event->update($data); 81 | $event->tags()->sync($request->tags); 82 | return to_route('events.index'); 83 | } 84 | 85 | /** 86 | * Remove the specified resource from storage. 87 | */ 88 | public function destroy(Event $event): RedirectResponse 89 | { 90 | Storage::delete($event->image); 91 | $event->tags()->detach(); 92 | $event->delete(); 93 | return to_route('events.index'); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /app/Http/Controllers/EventIndexController.php: -------------------------------------------------------------------------------- 1 | orderBy('created_at', 'desc')->paginate(12); 15 | return view('eventIndex', compact('events')); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Controllers/EventShowController.php: -------------------------------------------------------------------------------- 1 | likes()->where('user_id', auth()->id())->first(); 17 | $savedEvent = $event->savedEvents()->where('user_id', auth()->id())->first(); 18 | $attending = $event->attendings()->where('user_id', auth()->id())->first(); 19 | 20 | return view('eventsShow', compact('event', 'like', 'savedEvent', 'attending')); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Controllers/GalleryController.php: -------------------------------------------------------------------------------- 1 | user()->galleries; 17 | return view('galleries.index', compact('galleries')); 18 | } 19 | 20 | /** 21 | * Show the form for creating a new resource. 22 | */ 23 | public function create() 24 | { 25 | return view('galleries.create'); 26 | } 27 | 28 | /** 29 | * Store a newly created resource in storage. 30 | */ 31 | public function store(Request $request) 32 | { 33 | $this->validate($request, [ 34 | 'caption' => 'required', 35 | 'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048', 36 | ]); 37 | if ($request->hasFile('image')) { 38 | auth()->user()->galleries()->create([ 39 | 'caption' => $request->input('caption'), 40 | 'image' => $request->file('image')->store('galleries', 'public'), 41 | ]); 42 | 43 | return to_route('galleries.index'); 44 | } 45 | 46 | return back(); 47 | } 48 | 49 | 50 | /** 51 | * Show the form for editing the specified resource. 52 | */ 53 | public function edit(Gallery $gallery) 54 | { 55 | return view('galleries.edit', compact('gallery')); 56 | } 57 | 58 | /** 59 | * Update the specified resource in storage. 60 | */ 61 | public function update(Request $request, Gallery $gallery) 62 | { 63 | $path = $gallery->image; 64 | $this->validate($request, [ 65 | 'caption' => 'required', 66 | 'image' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:2048', 67 | ]); 68 | 69 | if ($request->hasFile('image')) { 70 | Storage::delete($gallery->image); 71 | $path = $request->file('image')->store('galleries', 'public'); 72 | } 73 | $gallery->update([ 74 | 'caption' => $request->input('caption'), 75 | 'image' => $path, 76 | ]); 77 | return to_route('galleries.index'); 78 | } 79 | 80 | /** 81 | * Remove the specified resource from storage. 82 | */ 83 | public function destroy(Gallery $gallery) 84 | { 85 | Storage::delete($gallery->image); 86 | $gallery->delete(); 87 | return back(); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /app/Http/Controllers/GalleryIndexController.php: -------------------------------------------------------------------------------- 1 | paginate(12); 15 | return view('galleryIndex', compact('galleries')); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Controllers/LikeSystemController.php: -------------------------------------------------------------------------------- 1 | likes()->where('user_id', auth()->id())->first(); 16 | if (!is_null($like)) { 17 | $like->delete(); 18 | return null; 19 | } else { 20 | $like = $event->likes()->create([ 21 | 'user_id' => auth()->id() 22 | ]); 23 | return $like; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Controllers/LikedEventController.php: -------------------------------------------------------------------------------- 1 | whereHas('likes', function ($q) { 15 | $q->where('user_id', auth()->id()); 16 | })->get(); 17 | 18 | return view('events.likedEvents', compact('events')); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Controllers/ProfileController.php: -------------------------------------------------------------------------------- 1 | $request->user(), 21 | ]); 22 | } 23 | 24 | /** 25 | * Update the user's profile information. 26 | */ 27 | public function update(ProfileUpdateRequest $request): RedirectResponse 28 | { 29 | $request->user()->fill($request->validated()); 30 | 31 | if ($request->user()->isDirty('email')) { 32 | $request->user()->email_verified_at = null; 33 | } 34 | 35 | $request->user()->save(); 36 | 37 | return Redirect::route('profile.edit')->with('status', 'profile-updated'); 38 | } 39 | 40 | /** 41 | * Delete the user's account. 42 | */ 43 | public function destroy(Request $request): RedirectResponse 44 | { 45 | $request->validateWithBag('userDeletion', [ 46 | 'password' => ['required', 'current_password'], 47 | ]); 48 | 49 | $user = $request->user(); 50 | 51 | Auth::logout(); 52 | 53 | $user->delete(); 54 | 55 | $request->session()->invalidate(); 56 | $request->session()->regenerateToken(); 57 | 58 | return Redirect::to('/'); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /app/Http/Controllers/SavedEventController.php: -------------------------------------------------------------------------------- 1 | whereHas('savedEvents', function ($q) { 15 | $q->where('user_id', auth()->id()); 16 | })->get(); 17 | 18 | return view('events.savedEvents', compact('events')); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Controllers/SavedEventSystemController.php: -------------------------------------------------------------------------------- 1 | savedEvents()->where('user_id', auth()->id())->first(); 16 | if (!is_null($savedEvent)) { 17 | $savedEvent->delete(); 18 | return null; 19 | } else { 20 | $savedEvent = $event->savedEvents()->create([ 21 | 'user_id' => auth()->id() 22 | ]); 23 | return $savedEvent; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Controllers/StoreCommentController.php: -------------------------------------------------------------------------------- 1 | comments()->create([ 17 | 'content' => $request->content, 18 | 'user_id' => auth()->id() 19 | ]); 20 | 21 | return back(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Http/Controllers/WelcomeController.php: -------------------------------------------------------------------------------- 1 | where('start_date', '>=', today())->orderBy('created_at', 'desc')->get(); 15 | 16 | return view('welcome', compact('events')); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | protected $middleware = [ 17 | // \App\Http\Middleware\TrustHosts::class, 18 | \App\Http\Middleware\TrustProxies::class, 19 | \Illuminate\Http\Middleware\HandleCors::class, 20 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class, 21 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, 22 | \App\Http\Middleware\TrimStrings::class, 23 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, 24 | ]; 25 | 26 | /** 27 | * The application's route middleware groups. 28 | * 29 | * @var array{{ $tag->name }}
24 | @endforeach 25 | 26 |17 | Title 18 | | 19 |20 | Start Date 21 | | 22 |23 | Country 24 | | 25 |26 | Action 27 | | 28 |
---|---|---|---|
35 | {{ $event->title }} 36 | | 37 |38 | {{ $event->start_date }} 39 | | 40 |41 | {{ $event->country->name }} 42 | | 43 |
44 |
45 | View
47 |
48 | |
49 |
53 | No events found 54 | | 55 |
20 | Title 21 | | 22 |23 | Start Date 24 | | 25 |26 | Country 27 | | 28 |29 | Action 30 | | 31 |
---|---|---|---|
38 | {{ $event->title }} 39 | | 40 |41 | {{ $event->start_date }} 42 | | 43 |44 | {{ $event->country->name }} 45 | | 46 |
47 |
48 | Edit
50 |
60 |
61 | |
62 |
66 | No events found 67 | | 68 |
17 | Title 18 | | 19 |20 | Start Date 21 | | 22 |23 | Country 24 | | 25 |26 | Action 27 | | 28 |
---|---|---|---|
35 | {{ $event->title }} 36 | | 37 |38 | {{ $event->start_date }} 39 | | 40 |41 | {{ $event->country->name }} 42 | | 43 |
44 |
45 | View
47 |
48 | |
49 |
53 | No events found 54 | | 55 |
17 | Title 18 | | 19 |20 | Start Date 21 | | 22 |23 | Country 24 | | 25 |26 | Action 27 | | 28 |
---|---|---|---|
35 | {{ $event->title }} 36 | | 37 |38 | {{ $event->start_date }} 39 | | 40 |41 | {{ $event->country->name }} 42 | | 43 |
44 |
45 | View
47 |
48 | |
49 |
53 | No events found 54 | | 55 |
20 | Image 21 | | 22 |23 | Caption 24 | | 25 |26 | Action 27 | | 28 ||
---|---|---|---|
35 | |
37 | 38 | {{ $gallery->caption }} 39 | | 40 |
41 |
42 | Edit
44 |
54 |
55 | |
56 | |
60 | No Gallery found 61 | | 62 |
8 | {{ __('Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.') }} 9 |
10 |8 | {{ __('Ensure your account is using a long, random password to stay secure.') }} 9 |
10 |8 | {{ __("Update your account's profile information and email address.") }} 9 |
10 |{{ $tag->name }}
24 | @endforeach 25 | 26 |