├── .dockerignore ├── .editorconfig ├── .env.example ├── .fly ├── entrypoint.sh └── scripts │ └── caches.sh ├── .gitattributes ├── .gitignore ├── Dockerfile ├── README.md ├── app ├── Console │ ├── Commands │ │ └── SendScheduledNotes.php │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Auth │ │ │ └── VerifyEmailController.php │ │ └── Controller.php │ ├── Kernel.php │ └── Middleware │ │ ├── Authenticate.php │ │ ├── EncryptCookies.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustHosts.php │ │ ├── TrustProxies.php │ │ ├── ValidateSignature.php │ │ └── VerifyCsrfToken.php ├── Jobs │ └── SendEmail.php ├── Livewire │ ├── Actions │ │ └── Logout.php │ └── Forms │ │ └── LoginForm.php ├── Models │ ├── Note.php │ └── User.php ├── Policies │ └── NotePolicy.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ ├── RouteServiceProvider.php │ └── VoltServiceProvider.php └── View │ └── Components │ ├── AppLayout.php │ └── GuestLayout.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── cors.php ├── database.php ├── filesystems.php ├── hashing.php ├── logging.php ├── mail.php ├── queue.php ├── sanctum.php ├── services.php ├── session.php ├── view.php └── wireui.php ├── database ├── .gitignore ├── factories │ ├── NoteFactory.php │ └── 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_12_09_064553_create_notes_table.php │ └── 2023_12_13_055527_add_recipient_to_notes_table.php └── seeders │ ├── DatabaseSeeder.php │ └── NoteSeeder.php ├── fly.toml ├── 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 │ ├── components │ ├── action-message.blade.php │ ├── 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 │ ├── layouts │ ├── app.blade.php │ └── guest.blade.php │ ├── livewire │ ├── .gitkeep │ ├── dashboardstats.blade.php │ ├── heartreact.blade.php │ ├── layout │ │ └── navigation.blade.php │ ├── notes │ │ ├── create-note.blade.php │ │ ├── edit-note.blade.php │ │ └── show-notes.blade.php │ ├── pages │ │ └── auth │ │ │ ├── confirm-password.blade.php │ │ │ ├── forgot-password.blade.php │ │ │ ├── login.blade.php │ │ │ ├── register.blade.php │ │ │ ├── reset-password.blade.php │ │ │ └── verify-email.blade.php │ ├── profile │ │ ├── delete-user-form.blade.php │ │ ├── update-password-form.blade.php │ │ └── update-profile-information-form.blade.php │ └── welcome │ │ └── navigation.blade.php │ ├── notes │ ├── create.blade.php │ ├── index.blade.php │ └── view.blade.php │ ├── profile.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 /.dockerignore: -------------------------------------------------------------------------------- 1 | # excludes from the docker image/build 2 | 3 | # 1. Ignore Laravel-specific files we don't need 4 | bootstrap/cache/* 5 | storage/framework/cache/* 6 | storage/framework/sessions/* 7 | storage/framework/views/* 8 | storage/logs/* 9 | *.env* 10 | .rr.yml 11 | rr 12 | vendor 13 | 14 | # 2. Ignore common files/directories we don't need 15 | fly.toml 16 | .vscode 17 | .idea 18 | **/*node_modules 19 | **.git 20 | **.gitignore 21 | **.gitattributes 22 | **.sass-cache 23 | **/*~ 24 | **/*.log 25 | **/.DS_Store 26 | **/Thumbs.db 27 | public/hot 28 | -------------------------------------------------------------------------------- /.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=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=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 | -------------------------------------------------------------------------------- /.fly/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # Run user scripts, if they exist 4 | for f in /var/www/html/.fly/scripts/*.sh; do 5 | # Bail out this loop if any script exits with non-zero status code 6 | bash "$f" || break 7 | done 8 | chown -R www-data:www-data /var/www/html 9 | 10 | if [ $# -gt 0 ]; then 11 | # If we passed a command, run it as root 12 | exec "$@" 13 | else 14 | exec supervisord -c /etc/supervisor/supervisord.conf 15 | fi 16 | -------------------------------------------------------------------------------- /.fly/scripts/caches.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | /usr/bin/php /var/www/html/artisan config:cache --no-ansi -q 4 | /usr/bin/php /var/www/html/artisan route:cache --no-ansi -q 5 | /usr/bin/php /var/www/html/artisan view:cache --no-ansi -q 6 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax = docker/dockerfile:experimental 2 | 3 | # Default to PHP 8.2, but we attempt to match 4 | # the PHP version from the user (wherever `flyctl launch` is run) 5 | # Valid version values are PHP 7.4+ 6 | ARG PHP_VERSION=8.2 7 | ARG NODE_VERSION=18 8 | FROM fideloper/fly-laravel:${PHP_VERSION} as base 9 | 10 | # PHP_VERSION needs to be repeated here 11 | # See https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact 12 | ARG PHP_VERSION 13 | 14 | LABEL fly_launch_runtime="laravel" 15 | 16 | # copy application code, skipping files based on .dockerignore 17 | COPY . /var/www/html 18 | 19 | RUN composer install --optimize-autoloader --no-dev \ 20 | && mkdir -p storage/logs \ 21 | && php artisan optimize:clear \ 22 | && chown -R www-data:www-data /var/www/html \ 23 | && sed -i 's/protected \$proxies/protected \$proxies = "*"/g' app/Http/Middleware/TrustProxies.php \ 24 | && echo "MAILTO=\"\"\n* * * * * www-data /usr/bin/php /var/www/html/artisan schedule:run" > /etc/cron.d/laravel \ 25 | && cp .fly/entrypoint.sh /entrypoint \ 26 | && chmod +x /entrypoint 27 | 28 | # If we're using Octane... 29 | RUN if grep -Fq "laravel/octane" /var/www/html/composer.json; then \ 30 | rm -rf /etc/supervisor/conf.d/fpm.conf; \ 31 | if grep -Fq "spiral/roadrunner" /var/www/html/composer.json; then \ 32 | mv /etc/supervisor/octane-rr.conf /etc/supervisor/conf.d/octane-rr.conf; \ 33 | if [ -f ./vendor/bin/rr ]; then ./vendor/bin/rr get-binary; fi; \ 34 | rm -f .rr.yaml; \ 35 | else \ 36 | mv .fly/octane-swoole /etc/services.d/octane; \ 37 | mv /etc/supervisor/octane-swoole.conf /etc/supervisor/conf.d/octane-swoole.conf; \ 38 | fi; \ 39 | rm /etc/nginx/sites-enabled/default; \ 40 | ln -sf /etc/nginx/sites-available/default-octane /etc/nginx/sites-enabled/default; \ 41 | fi 42 | 43 | # Multi-stage build: Build static assets 44 | # This allows us to not include Node within the final container 45 | FROM node:${NODE_VERSION} as node_modules_go_brrr 46 | 47 | RUN mkdir /app 48 | 49 | RUN mkdir -p /app 50 | WORKDIR /app 51 | COPY . . 52 | COPY --from=base /var/www/html/vendor /app/vendor 53 | 54 | # Use yarn or npm depending on what type of 55 | # lock file we might find. Defaults to 56 | # NPM if no lock file is found. 57 | # Note: We run "production" for Mix and "build" for Vite 58 | RUN if [ -f "vite.config.js" ]; then \ 59 | ASSET_CMD="build"; \ 60 | else \ 61 | ASSET_CMD="production"; \ 62 | fi; \ 63 | if [ -f "yarn.lock" ]; then \ 64 | yarn install --frozen-lockfile; \ 65 | yarn $ASSET_CMD; \ 66 | elif [ -f "pnpm-lock.yaml" ]; then \ 67 | corepack enable && corepack prepare pnpm@latest-8 --activate; \ 68 | pnpm install --frozen-lockfile; \ 69 | pnpm run $ASSET_CMD; \ 70 | elif [ -f "package-lock.json" ]; then \ 71 | npm ci --no-audit; \ 72 | npm run $ASSET_CMD; \ 73 | else \ 74 | npm install; \ 75 | npm run $ASSET_CMD; \ 76 | fi; 77 | 78 | # From our base container created above, we 79 | # create our final image, adding in static 80 | # assets that we generated above 81 | FROM base 82 | 83 | # Packages like Laravel Nova may have added assets to the public directory 84 | # or maybe some custom assets were added manually! Either way, we merge 85 | # in the assets we generated above rather than overwrite them 86 | COPY --from=node_modules_go_brrr /app/public /var/www/html/public-npm 87 | RUN rsync -ar /var/www/html/public-npm/ /var/www/html/public/ \ 88 | && rm -rf /var/www/html/public-npm \ 89 | && chown -R www-data:www-data /var/www/html/public 90 | 91 | EXPOSE 8080 92 | 93 | ENTRYPOINT ["/entrypoint"] 94 | -------------------------------------------------------------------------------- /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 Partners program](https://partners.laravel.com). 35 | 36 | ### Premium Partners 37 | 38 | - **[Vehikl](https://vehikl.com/)** 39 | - **[Tighten Co.](https://tighten.co)** 40 | - **[WebReinvent](https://webreinvent.com/)** 41 | - **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** 42 | - **[64 Robots](https://64robots.com)** 43 | - **[Curotec](https://www.curotec.com/services/technologies/laravel/)** 44 | - **[Cyber-Duck](https://cyber-duck.co.uk)** 45 | - **[DevSquad](https://devsquad.com/hire-laravel-developers)** 46 | - **[Jump24](https://jump24.co.uk)** 47 | - **[Redberry](https://redberry.international/laravel/)** 48 | - **[Active Logic](https://activelogic.com)** 49 | - **[byte5](https://byte5.de)** 50 | - **[OP.GG](https://op.gg)** 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/Commands/SendScheduledNotes.php: -------------------------------------------------------------------------------- 1 | where('send_date', $now->toDateString()) 35 | ->get(); 36 | 37 | $noteCount = $notes->count(); 38 | $this->info("Sending {$noteCount} scheduled notes."); 39 | 40 | foreach ($notes as $note) { 41 | SendEmail::dispatch($note); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('app:send-scheduled-notes')->timezone('America/New_York')->dailyAt('09:00'); 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/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 | 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 arrayNotes Sent
26 |{{ $notesSentCount }}
30 |Notes Loved
36 |{{ $notesLovedCount }}
40 |No notes yet
43 |Let's create your first note to send.
44 |{{ $note->title }}
60 | @endcan 61 |{{ Str::limit($note->body, 50) }}
62 |Recipient: {{ $note->recipient }}
69 |33 | {{ __('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.') }} 34 |
35 |48 | {{ __('Ensure your account is using a long, random password to stay secure.') }} 49 |
50 |74 | {{ __("Update your account's profile information and email address.") }} 75 |
76 |{{ $note->body }}
8 |