├── .vscode └── settings.json ├── book-review-resources ├── app.blade.php ├── book-item.html ├── book.blade.php └── reset-items.html ├── book-review ├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── README.md ├── app │ ├── Console │ │ └── Kernel.php │ ├── Exceptions │ │ └── Handler.php │ ├── Http │ │ ├── Controllers │ │ │ ├── BookController.php │ │ │ ├── Controller.php │ │ │ └── ReviewController.php │ │ ├── Kernel.php │ │ └── Middleware │ │ │ ├── Authenticate.php │ │ │ ├── EncryptCookies.php │ │ │ ├── PreventRequestsDuringMaintenance.php │ │ │ ├── RedirectIfAuthenticated.php │ │ │ ├── TrimStrings.php │ │ │ ├── TrustHosts.php │ │ │ ├── TrustProxies.php │ │ │ ├── ValidateSignature.php │ │ │ └── VerifyCsrfToken.php │ ├── Models │ │ ├── Book.php │ │ ├── Review.php │ │ └── User.php │ ├── Providers │ │ ├── AppServiceProvider.php │ │ ├── AuthServiceProvider.php │ │ ├── BroadcastServiceProvider.php │ │ ├── EventServiceProvider.php │ │ └── RouteServiceProvider.php │ └── View │ │ └── Components │ │ └── StarRating.php ├── artisan ├── bootstrap │ ├── app.php │ ├── cache │ │ └── .gitignore │ └── providers.php ├── 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 │ │ ├── BookFactory.php │ │ ├── ReviewFactory.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 │ │ ├── 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_04_04_173425_create_books_table.php │ │ └── 2023_04_04_173434_create_reviews_table.php │ └── seeders │ │ └── DatabaseSeeder.php ├── 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 │ │ ├── books │ │ ├── index.blade.php │ │ ├── reviews │ │ │ └── create.blade.php │ │ └── show.blade.php │ │ ├── components │ │ └── star-rating.blade.php │ │ ├── layouts │ │ └── app.blade.php │ │ └── welcome.blade.php ├── routes │ ├── api.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 │ │ └── ExampleTest.php │ ├── TestCase.php │ └── Unit │ │ └── ExampleTest.php └── vite.config.js ├── event-management ├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── README.md ├── app │ ├── Console │ │ └── Commands │ │ │ └── SendEventReminders.php │ ├── Http │ │ ├── Controllers │ │ │ ├── Api │ │ │ │ ├── AttendeeController.php │ │ │ │ ├── AuthController.php │ │ │ │ └── EventController.php │ │ │ └── Controller.php │ │ ├── Resources │ │ │ ├── AttendeeResource.php │ │ │ ├── EventResource.php │ │ │ └── UserResource.php │ │ └── Traits │ │ │ └── CanLoadRelationships.php │ ├── Models │ │ ├── Attendee.php │ │ ├── Event.php │ │ └── User.php │ ├── Notifications │ │ └── EventReminderNotification.php │ ├── Policies │ │ ├── AttendeePolicy.php │ │ └── EventPolicy.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 │ ├── sanctum.php │ ├── services.php │ └── session.php ├── database │ ├── .gitignore │ ├── factories │ │ ├── EventFactory.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 │ │ ├── 2023_04_23_163049_create_events_table.php │ │ ├── 2023_04_23_163057_create_attendees_table.php │ │ └── 2024_10_24_120205_create_personal_access_tokens_table.php │ └── seeders │ │ ├── AttendeeSeeder.php │ │ ├── DatabaseSeeder.php │ │ └── EventSeeder.php ├── 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 │ │ └── welcome.blade.php ├── routes │ ├── api.php │ ├── 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 ├── job-board ├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── README.md ├── app │ ├── Http │ │ ├── Controllers │ │ │ ├── AuthController.php │ │ │ ├── Controller.php │ │ │ ├── EmployerController.php │ │ │ ├── JobApplicationController.php │ │ │ ├── JobController.php │ │ │ ├── MyJobApplicationController.php │ │ │ └── MyJobController.php │ │ ├── Middleware │ │ │ └── Employer.php │ │ └── Requests │ │ │ └── JobRequest.php │ ├── Models │ │ ├── Employer.php │ │ ├── Job.php │ │ ├── JobApplication.php │ │ └── User.php │ ├── Policies │ │ ├── EmployerPolicy.php │ │ └── JobPolicy.php │ ├── Providers │ │ └── AppServiceProvider.php │ └── View │ │ └── Components │ │ ├── Breadcrumbs.php │ │ ├── Label.php │ │ ├── RadioGroup.php │ │ └── TextInput.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 │ │ ├── EmployerFactory.php │ │ ├── JobApplicationFactory.php │ │ ├── JobFactory.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 │ │ ├── 2023_05_15_152938_create_jobs_table.php │ │ ├── 2023_05_25_165601_create_employers_table.php │ │ ├── 2023_05_30_155859_create_job_applications_table.php │ │ ├── 2023_06_19_144746_add_cv_path_to_job_applications_table.php │ │ └── 2023_06_29_154702_add_soft_deletes_to_jobs_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 │ │ └── create.blade.php │ │ ├── components │ │ ├── breadcrumbs.blade.php │ │ ├── button.blade.php │ │ ├── card.blade.php │ │ ├── job-card.blade.php │ │ ├── label.blade.php │ │ ├── layout.blade.php │ │ ├── link-button.blade.php │ │ ├── radio-group.blade.php │ │ ├── tag.blade.php │ │ └── text-input.blade.php │ │ ├── employer │ │ └── create.blade.php │ │ ├── job │ │ ├── index.blade.php │ │ └── show.blade.php │ │ ├── job_application │ │ └── create.blade.php │ │ ├── my_job │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ └── index.blade.php │ │ └── my_job_application │ │ └── index.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 ├── l10-task-list-resources └── task-list.php ├── l10-task-list ├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── README.md ├── app │ ├── Http │ │ ├── Controllers │ │ │ └── Controller.php │ │ └── Requests │ │ │ └── TaskRequest.php │ ├── Models │ │ ├── Task.php │ │ └── User.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 │ │ ├── TaskFactory.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 │ │ └── 2023_03_28_162430_create_tasks_table.php │ └── seeders │ │ └── DatabaseSeeder.php ├── 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 │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── form.blade.php │ │ ├── index.blade.php │ │ ├── layouts │ │ └── app.blade.php │ │ └── show.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 ├── livewire-poll-resources └── app.blade.php ├── livewire-poll ├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── README.md ├── app │ ├── Http │ │ └── Controllers │ │ │ └── Controller.php │ ├── Livewire │ │ ├── CreatePoll.php │ │ └── Polls.php │ ├── Models │ │ ├── Option.php │ │ ├── Poll.php │ │ ├── User.php │ │ └── Vote.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 │ │ └── 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 │ │ ├── 2023_05_10_171604_create_polls_table.php │ │ ├── 2023_05_10_171605_create_options_table.php │ │ └── 2023_05_10_171618_create_votes_table.php │ └── seeders │ │ └── DatabaseSeeder.php ├── 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 │ │ ├── app.blade.php │ │ └── livewire │ │ ├── create-poll.blade.php │ │ └── polls.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 └── task-list ├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── README.md ├── app ├── Http │ └── Controllers │ │ └── Controller.php ├── Models │ └── User.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 │ └── 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 └── seeders │ └── DatabaseSeeder.php ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── favicon.ico ├── index.php └── robots.txt ├── resources ├── css │ └── app.css ├── js │ ├── app.js │ └── bootstrap.js └── views │ └── welcome.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 ├── tests ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php └── vite.config.js /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.guides.highlightActiveIndentation": false, 3 | "editor.guides.indentation": false 4 | } -------------------------------------------------------------------------------- /book-review-resources/book-item.html: -------------------------------------------------------------------------------- 1 |
  • 2 |
    3 |
    5 |
    6 | Book Title 7 | by Piotr Jura 8 |
    9 |
    10 |
    11 | 3.5 12 |
    13 |
    14 | out of 5 reviews 15 |
    16 |
    17 |
    18 |
    19 |
  • -------------------------------------------------------------------------------- /book-review-resources/reset-items.html: -------------------------------------------------------------------------------- 1 |
  • 2 |
    3 |

    No books found

    4 | Reset criteria 5 |
    6 |
  • -------------------------------------------------------------------------------- /book-review/.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 | -------------------------------------------------------------------------------- /book-review/.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_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 | -------------------------------------------------------------------------------- /book-review/.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 | -------------------------------------------------------------------------------- /book-review/.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 | -------------------------------------------------------------------------------- /book-review/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 | -------------------------------------------------------------------------------- /book-review/app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | , \Psr\Log\LogLevel::*> 14 | */ 15 | protected $levels = [ 16 | // 17 | ]; 18 | 19 | /** 20 | * A list of the exception types that are not reported. 21 | * 22 | * @var array> 23 | */ 24 | protected $dontReport = [ 25 | // 26 | ]; 27 | 28 | /** 29 | * A list of the inputs that are never flashed to the session on validation exceptions. 30 | * 31 | * @var array 32 | */ 33 | protected $dontFlash = [ 34 | 'current_password', 35 | 'password', 36 | 'password_confirmation', 37 | ]; 38 | 39 | /** 40 | * Register the exception handling callbacks for the application. 41 | */ 42 | public function register(): void 43 | { 44 | $this->reportable(function (Throwable $e) { 45 | // 46 | }); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /book-review/app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | $book]); 13 | } 14 | 15 | public function store(Request $request, Book $book) 16 | { 17 | $data = $request->validate([ 18 | 'review' => 'required|min:15', 19 | 'rating' => 'required|min:1|max:5|integer' 20 | ]); 21 | 22 | $book->reviews()->create($data); 23 | 24 | return redirect()->route('books.show', $book); 25 | } 26 | } -------------------------------------------------------------------------------- /book-review/app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson() ? null : route('login'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /book-review/app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /book-review/app/Http/Middleware/PreventRequestsDuringMaintenance.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /book-review/app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 24 | return redirect(RouteServiceProvider::HOME); 25 | } 26 | } 27 | 28 | return $next($request); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /book-review/app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | 'current_password', 16 | 'password', 17 | 'password_confirmation', 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /book-review/app/Http/Middleware/TrustHosts.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public function hosts(): array 15 | { 16 | return [ 17 | $this->allSubdomainsOfApplicationUrl(), 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /book-review/app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | |string|null 14 | */ 15 | protected $proxies; 16 | 17 | /** 18 | * The headers that should be used to detect proxies. 19 | * 20 | * @var int 21 | */ 22 | protected $headers = 23 | Request::HEADER_X_FORWARDED_FOR | 24 | Request::HEADER_X_FORWARDED_HOST | 25 | Request::HEADER_X_FORWARDED_PORT | 26 | Request::HEADER_X_FORWARDED_PROTO | 27 | Request::HEADER_X_FORWARDED_AWS_ELB; 28 | } 29 | -------------------------------------------------------------------------------- /book-review/app/Http/Middleware/ValidateSignature.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 'fbclid', 16 | // 'utm_campaign', 17 | // 'utm_content', 18 | // 'utm_medium', 19 | // 'utm_source', 20 | // 'utm_term', 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /book-review/app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /book-review/app/Models/Review.php: -------------------------------------------------------------------------------- 1 | belongsTo(Book::class); 17 | } 18 | 19 | protected static function booted() 20 | { 21 | static::updated(fn(Review $review) => cache()->forget('book:' . $review->book_id)); 22 | static::deleted(fn(Review $review) => cache()->forget('book:' . $review->book_id)); 23 | static::created(fn(Review $review) => cache()->forget('book:' . $review->book_id)); 24 | } 25 | } -------------------------------------------------------------------------------- /book-review/app/Models/User.php: -------------------------------------------------------------------------------- 1 | */ 13 | use HasFactory, Notifiable; 14 | 15 | /** 16 | * The attributes that are mass assignable. 17 | * 18 | * @var array 19 | */ 20 | protected $fillable = [ 21 | 'name', 22 | 'email', 23 | 'password', 24 | ]; 25 | 26 | /** 27 | * The attributes that should be hidden for serialization. 28 | * 29 | * @var array 30 | */ 31 | protected $hidden = [ 32 | 'password', 33 | 'remember_token', 34 | ]; 35 | 36 | /** 37 | * Get the attributes that should be cast. 38 | * 39 | * @return array 40 | */ 41 | protected function casts(): array 42 | { 43 | return [ 44 | 'email_verified_at' => 'datetime', 45 | 'password' => 'hashed', 46 | ]; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /book-review/app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | by($request->user()?->id ?: $request->ip()); 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /book-review/app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | protected $policies = [ 16 | // 'App\Models\Model' => 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | */ 22 | public function boot(): void 23 | { 24 | // 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /book-review/app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | > 16 | */ 17 | protected $listen = [ 18 | Registered::class => [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | */ 26 | public function boot(): void 27 | { 28 | // 29 | } 30 | 31 | /** 32 | * Determine if events and listeners should be automatically discovered. 33 | */ 34 | public function shouldDiscoverEvents(): bool 35 | { 36 | return false; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /book-review/app/View/Components/StarRating.php: -------------------------------------------------------------------------------- 1 | handleCommand(new ArgvInput); 14 | 15 | exit($status); 16 | -------------------------------------------------------------------------------- /book-review/bootstrap/app.php: -------------------------------------------------------------------------------- 1 | withRouting( 9 | web: __DIR__.'/../routes/web.php', 10 | commands: __DIR__.'/../routes/console.php', 11 | health: '/up', 12 | ) 13 | ->withMiddleware(function (Middleware $middleware) { 14 | // 15 | }) 16 | ->withExceptions(function (Exceptions $exceptions) { 17 | // 18 | })->create(); 19 | -------------------------------------------------------------------------------- /book-review/bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /book-review/bootstrap/providers.php: -------------------------------------------------------------------------------- 1 | ['api/*', 'sanctum/csrf-cookie'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => [], 29 | 30 | 'max_age' => 0, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /book-review/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 | -------------------------------------------------------------------------------- /book-review/config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /book-review/database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /book-review/database/factories/BookFactory.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | class BookFactory extends Factory 11 | { 12 | /** 13 | * Define the model's default state. 14 | * 15 | * @return array 16 | */ 17 | public function definition(): array 18 | { 19 | return [ 20 | 'title' => fake()->sentence(3), 21 | 'author' => fake()->name, 22 | 'created_at' => fake()->dateTimeBetween('-2 years'), 23 | 'updated_at' => function (array $attributes) { 24 | return fake()->dateTimeBetween($attributes['created_at'], 'now'); 25 | }, 26 | ]; 27 | } 28 | } -------------------------------------------------------------------------------- /book-review/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 | -------------------------------------------------------------------------------- /book-review/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 | -------------------------------------------------------------------------------- /book-review/database/migrations/2014_10_12_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 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('users'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /book-review/database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php: -------------------------------------------------------------------------------- 1 | string('email')->primary(); 16 | $table->string('token'); 17 | $table->timestamp('created_at')->nullable(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | */ 24 | public function down(): void 25 | { 26 | Schema::dropIfExists('password_reset_tokens'); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /book-review/database/migrations/2019_08_19_000000_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('uuid')->unique(); 17 | $table->text('connection'); 18 | $table->text('queue'); 19 | $table->longText('payload'); 20 | $table->longText('exception'); 21 | $table->timestamp('failed_at')->useCurrent(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('failed_jobs'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /book-review/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->morphs('tokenable'); 17 | $table->string('name'); 18 | $table->string('token', 64)->unique(); 19 | $table->text('abilities')->nullable(); 20 | $table->timestamp('last_used_at')->nullable(); 21 | $table->timestamp('expires_at')->nullable(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | */ 29 | public function down(): void 30 | { 31 | Schema::dropIfExists('personal_access_tokens'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /book-review/database/migrations/2023_04_04_173425_create_books_table.php: -------------------------------------------------------------------------------- 1 | id(); 15 | 16 | $table->string('title'); 17 | $table->string('author'); 18 | 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | */ 26 | public function down(): void 27 | { 28 | Schema::dropIfExists('books'); 29 | } 30 | }; -------------------------------------------------------------------------------- /book-review/database/migrations/2023_04_04_173434_create_reviews_table.php: -------------------------------------------------------------------------------- 1 | id(); 15 | 16 | // $table->unsignedBigInteger('book_id'); 17 | 18 | $table->text('review'); 19 | $table->unsignedTinyInteger('rating'); 20 | 21 | $table->timestamps(); 22 | 23 | // $table->foreign('book_id')->references('id')->on('books') 24 | // ->onDelete('cascade'); 25 | 26 | $table->foreignId('book_id')->constrained() 27 | ->cascadeOnDelete(); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | */ 34 | public function down(): void 35 | { 36 | Schema::dropIfExists('reviews'); 37 | } 38 | }; -------------------------------------------------------------------------------- /book-review/database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create()->each(function ($book) { 18 | $numReviews = random_int(5, 30); 19 | 20 | Review::factory()->count($numReviews) 21 | ->good() 22 | ->for($book) 23 | ->create(); 24 | }); 25 | 26 | Book::factory(33)->create()->each(function ($book) { 27 | $numReviews = random_int(5, 30); 28 | 29 | Review::factory()->count($numReviews) 30 | ->average() 31 | ->for($book) 32 | ->create(); 33 | }); 34 | 35 | Book::factory(34)->create()->each(function ($book) { 36 | $numReviews = random_int(5, 30); 37 | 38 | Review::factory()->count($numReviews) 39 | ->bad() 40 | ->for($book) 41 | ->create(); 42 | }); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /book-review/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "type": "module", 4 | "scripts": { 5 | "build": "vite build", 6 | "dev": "vite" 7 | }, 8 | "devDependencies": { 9 | "autoprefixer": "^10.4.20", 10 | "axios": "^1.7.4", 11 | "concurrently": "^9.0.1", 12 | "laravel-vite-plugin": "^1.0", 13 | "postcss": "^8.4.47", 14 | "tailwindcss": "^3.4.13", 15 | "vite": "^5.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /book-review/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 | -------------------------------------------------------------------------------- /book-review/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /book-review/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 | -------------------------------------------------------------------------------- /book-review/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piotr-jura-udemy/laravel-course-2023/fdcc0332d2f6be0d732f73f0aace4a3913b52945/book-review/public/favicon.ico -------------------------------------------------------------------------------- /book-review/public/index.php: -------------------------------------------------------------------------------- 1 | handleRequest(Request::capture()); 18 | -------------------------------------------------------------------------------- /book-review/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /book-review/resources/css/app.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /book-review/resources/js/app.js: -------------------------------------------------------------------------------- 1 | import './bootstrap'; 2 | -------------------------------------------------------------------------------- /book-review/resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | window.axios = axios; 3 | 4 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 5 | -------------------------------------------------------------------------------- /book-review/resources/views/books/reviews/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |

    Add Review for {{ $book->title }}

    5 | 6 |
    7 | @csrf 8 | 9 | 10 | 11 | 12 | 13 | 19 | 20 | 21 |
    22 | @endsection 23 | -------------------------------------------------------------------------------- /book-review/resources/views/components/star-rating.blade.php: -------------------------------------------------------------------------------- 1 | @if ($rating) 2 | @for ($i = 1; $i <= 5; $i++) 3 | {{ $i <= round($rating) ? '★' : '☆' }} 4 | @endfor 5 | @else 6 | No rating yet 7 | @endif 8 | -------------------------------------------------------------------------------- /book-review/routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 18 | return $request->user(); 19 | }); 20 | -------------------------------------------------------------------------------- /book-review/routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /book-review/routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 8 | })->purpose('Display an inspiring quote')->hourly(); 9 | -------------------------------------------------------------------------------- /book-review/routes/web.php: -------------------------------------------------------------------------------- 1 | route('books.index'); 9 | }); 10 | 11 | Route::resource('books', controller: BookController::class) 12 | ->only(['index', 'show']); 13 | 14 | Route::get('books/{book}/reviews/create', [ReviewController::class, 'create']) 15 | ->name('books.reviews.create'); 16 | 17 | Route::post('books/{book}/reviews', [ReviewController::class, 'store']) 18 | ->name('books.reviews.store') 19 | ->middleware('throttle:reviews'); -------------------------------------------------------------------------------- /book-review/storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /book-review/storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /book-review/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 | -------------------------------------------------------------------------------- /book-review/storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /book-review/storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /book-review/storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /book-review/storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /book-review/storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /book-review/storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /book-review/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 | }; 21 | -------------------------------------------------------------------------------- /book-review/tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 18 | 19 | return $app; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /book-review/tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 16 | 17 | $response->assertStatus(200); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /book-review/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /book-review/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | laravel({ 7 | input: ['resources/css/app.css', 'resources/js/app.js'], 8 | refresh: true, 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /event-management/.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 | -------------------------------------------------------------------------------- /event-management/.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_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 | -------------------------------------------------------------------------------- /event-management/.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 | -------------------------------------------------------------------------------- /event-management/.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 | -------------------------------------------------------------------------------- /event-management/README.md: -------------------------------------------------------------------------------- 1 | # Laravel Event Management System 2 | 3 | This is a simple event management system built with Laravel. It allows users to attend events and receive reminders before the event starts. 4 | 5 | ## Features 6 | 7 | - User registration and login 8 | - Event creation and management 9 | - User attendance tracking 10 | - Event reminders via email 11 | 12 | ## Installation 13 | 14 | 1. Clone the repository 15 | 2. Run `composer install` to install dependencies 16 | 3. Run `php artisan migrate` to migrate the database 17 | 4. Run `php artisan db:seed` to seed the database with initial data 18 | 5. Run `php artisan serve` to start the development server 19 | 20 | ## Usage 21 | 22 | 1. Register as a user 23 | 2. Create or attend events 24 | 3. Receive reminders for upcoming events 25 | -------------------------------------------------------------------------------- /event-management/app/Http/Controllers/Api/AuthController.php: -------------------------------------------------------------------------------- 1 | validate([ 15 | 'email' => 'required|email', 16 | 'password' => 'required' 17 | ]); 18 | 19 | $user = \App\Models\User::where('email', $request->email)->first(); 20 | 21 | if (!$user) { 22 | throw ValidationException::withMessages([ 23 | 'email' => ['The provided credentials are incorrect.'] 24 | ]); 25 | } 26 | 27 | if (!Hash::check($request->password, $user->password)) { 28 | throw ValidationException::withMessages([ 29 | 'email' => ['The provided credentials are incorrect.'] 30 | ]); 31 | } 32 | 33 | $token = $user->createToken('api-token')->plainTextToken; 34 | 35 | return response()->json([ 36 | 'token' => $token 37 | ]); 38 | } 39 | 40 | public function logout(Request $request) 41 | { 42 | $request->user()->tokens()->delete(); 43 | 44 | return response()->json([ 45 | 'message' => 'Logged out successfully' 46 | ]); 47 | } 48 | } -------------------------------------------------------------------------------- /event-management/app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | public function toArray(Request $request): array 16 | { 17 | return parent::toArray($request); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /event-management/app/Http/Resources/EventResource.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | public function toArray(Request $request): array 16 | { 17 | return [ 18 | 'id' => $this->id, 19 | 'name' => $this->name, 20 | 'description' => $this->description, 21 | 'start_time' => $this->start_time, 22 | 'end_time' => $this->end_time, 23 | 'user' => new UserResource($this->whenLoaded('user')), 24 | 'attendees' => AttendeeResource::collection( 25 | $this->whenLoaded('attendees') 26 | ) 27 | ]; 28 | } 29 | } -------------------------------------------------------------------------------- /event-management/app/Http/Resources/UserResource.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | public function toArray(Request $request): array 16 | { 17 | return parent::toArray($request); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /event-management/app/Http/Traits/CanLoadRelationships.php: -------------------------------------------------------------------------------- 1 | relations ?? []; 17 | 18 | foreach ($relations as $relation) { 19 | $for->when( 20 | $this->shouldIncludeRelation($relation), 21 | fn($q) => $for instanceof Model ? $for->load($relation) : $q->with($relation) 22 | ); 23 | } 24 | 25 | return $for; 26 | } 27 | 28 | protected function shouldIncludeRelation(string $relation): bool 29 | { 30 | $include = request()->query('include'); 31 | 32 | if (!$include) { 33 | return false; 34 | } 35 | 36 | $relations = array_map('trim', explode(',', $include)); 37 | 38 | return in_array($relation, $relations); 39 | } 40 | } -------------------------------------------------------------------------------- /event-management/app/Models/Attendee.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 18 | } 19 | 20 | public function event(): BelongsTo 21 | { 22 | return $this->belongsTo(Event::class); 23 | } 24 | } -------------------------------------------------------------------------------- /event-management/app/Models/Event.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 19 | } 20 | 21 | public function attendees(): HasMany 22 | { 23 | return $this->hasMany(Attendee::class); 24 | } 25 | } -------------------------------------------------------------------------------- /event-management/app/Models/User.php: -------------------------------------------------------------------------------- 1 | */ 14 | use HasFactory, Notifiable, HasApiTokens; 15 | 16 | /** 17 | * The attributes that are mass assignable. 18 | * 19 | * @var array 20 | */ 21 | protected $fillable = [ 22 | 'name', 23 | 'email', 24 | 'password', 25 | ]; 26 | 27 | /** 28 | * The attributes that should be hidden for serialization. 29 | * 30 | * @var array 31 | */ 32 | protected $hidden = [ 33 | 'password', 34 | 'remember_token', 35 | ]; 36 | 37 | /** 38 | * Get the attributes that should be cast. 39 | * 40 | * @return array 41 | */ 42 | protected function casts(): array 43 | { 44 | return [ 45 | 'email_verified_at' => 'datetime', 46 | 'password' => 'hashed', 47 | ]; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /event-management/app/Policies/AttendeePolicy.php: -------------------------------------------------------------------------------- 1 | id === $attendee->event->user_id || 41 | $user->id === $attendee->user_id; 42 | } 43 | } -------------------------------------------------------------------------------- /event-management/app/Policies/EventPolicy.php: -------------------------------------------------------------------------------- 1 | id === $event->user_id; 41 | } 42 | 43 | /** 44 | * Determine whether the user can delete the model. 45 | */ 46 | public function delete(User $user, Event $event): bool 47 | { 48 | return $user->id === $event->user_id; 49 | } 50 | } -------------------------------------------------------------------------------- /event-management/app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | by($request->user()?->id ?: $request->ip()); 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /event-management/artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | handleCommand(new ArgvInput); 14 | 15 | exit($status); 16 | -------------------------------------------------------------------------------- /event-management/bootstrap/app.php: -------------------------------------------------------------------------------- 1 | withRouting( 9 | web: __DIR__.'/../routes/web.php', 10 | api: __DIR__.'/../routes/api.php', 11 | commands: __DIR__.'/../routes/console.php', 12 | health: '/up', 13 | ) 14 | ->withMiddleware(function (Middleware $middleware) { 15 | // 16 | }) 17 | ->withExceptions(function (Exceptions $exceptions) { 18 | // 19 | })->create(); 20 | -------------------------------------------------------------------------------- /event-management/bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /event-management/bootstrap/providers.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 | -------------------------------------------------------------------------------- /event-management/database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /event-management/database/factories/EventFactory.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | class EventFactory extends Factory 11 | { 12 | /** 13 | * Define the model's default state. 14 | * 15 | * @return array 16 | */ 17 | public function definition(): array 18 | { 19 | return [ 20 | 'name' => fake()->unique()->sentence(3), 21 | 'description' => fake()->text, 22 | 'start_time' => fake()->dateTimeBetween('now', '+1 month'), 23 | 'end_time' => fake()->dateTimeBetween('+1 month', '+2 months'), 24 | ]; 25 | } 26 | } -------------------------------------------------------------------------------- /event-management/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 | -------------------------------------------------------------------------------- /event-management/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 | -------------------------------------------------------------------------------- /event-management/database/migrations/2023_04_23_163049_create_events_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | 17 | $table->foreignIdFor(User::class); 18 | $table->string('name'); 19 | $table->text('description')->nullable(); 20 | 21 | $table->dateTime('start_time'); 22 | $table->dateTime('end_time'); 23 | 24 | $table->timestamps(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | */ 31 | public function down(): void 32 | { 33 | Schema::dropIfExists('events'); 34 | } 35 | }; -------------------------------------------------------------------------------- /event-management/database/migrations/2023_04_23_163057_create_attendees_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | 18 | $table->foreignIdFor(User::class); 19 | $table->foreignIdFor(Event::class); 20 | 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('attendees'); 31 | } 32 | }; -------------------------------------------------------------------------------- /event-management/database/migrations/2024_10_24_120205_create_personal_access_tokens_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->morphs('tokenable'); 17 | $table->string('name'); 18 | $table->string('token', 64)->unique(); 19 | $table->text('abilities')->nullable(); 20 | $table->timestamp('last_used_at')->nullable(); 21 | $table->timestamp('expires_at')->nullable(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | */ 29 | public function down(): void 30 | { 31 | Schema::dropIfExists('personal_access_tokens'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /event-management/database/seeders/AttendeeSeeder.php: -------------------------------------------------------------------------------- 1 | random(rand(1, 3)); 20 | 21 | foreach ($eventsToAttend as $event) { 22 | \App\Models\Attendee::create([ 23 | 'user_id' => $user->id, 24 | 'event_id' => $event->id 25 | ]); 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /event-management/database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 16 | 17 | $this->call(EventSeeder::class); 18 | $this->call(AttendeeSeeder::class); 19 | } 20 | } -------------------------------------------------------------------------------- /event-management/database/seeders/EventSeeder.php: -------------------------------------------------------------------------------- 1 | random(); 20 | \App\Models\Event::factory()->create([ 21 | 'user_id' => $user->id 22 | ]); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /event-management/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "type": "module", 4 | "scripts": { 5 | "build": "vite build", 6 | "dev": "vite" 7 | }, 8 | "devDependencies": { 9 | "autoprefixer": "^10.4.20", 10 | "axios": "^1.7.4", 11 | "concurrently": "^9.0.1", 12 | "laravel-vite-plugin": "^1.0", 13 | "postcss": "^8.4.47", 14 | "tailwindcss": "^3.4.13", 15 | "vite": "^5.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /event-management/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 | -------------------------------------------------------------------------------- /event-management/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /event-management/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 | -------------------------------------------------------------------------------- /event-management/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piotr-jura-udemy/laravel-course-2023/fdcc0332d2f6be0d732f73f0aace4a3913b52945/event-management/public/favicon.ico -------------------------------------------------------------------------------- /event-management/public/index.php: -------------------------------------------------------------------------------- 1 | handleRequest(Request::capture()); 18 | -------------------------------------------------------------------------------- /event-management/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /event-management/resources/css/app.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /event-management/resources/js/app.js: -------------------------------------------------------------------------------- 1 | import './bootstrap'; 2 | -------------------------------------------------------------------------------- /event-management/resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | window.axios = axios; 3 | 4 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 5 | -------------------------------------------------------------------------------- /event-management/routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 11 | return $request->user(); 12 | }); 13 | 14 | Route::post('/login', [AuthController::class, 'login']); 15 | Route::post('/logout', [AuthController::class, 'logout']) 16 | ->middleware('auth:sanctum'); 17 | 18 | // Public routes 19 | Route::apiResource('events', EventController::class) 20 | ->only(['index', 'show']); 21 | 22 | // Protected routes 23 | Route::apiResource('events', EventController::class) 24 | ->only(['store', 'update', 'destroy']) 25 | ->middleware(['auth:sanctum', 'throttle:api']); 26 | 27 | Route::middleware(['auth:sanctum', 'throttle:api'])->group(function () { 28 | Route::apiResource('events.attendees', AttendeeController::class) 29 | ->scoped() 30 | ->only(['store', 'destroy']); 31 | }); 32 | 33 | Route::apiResource('events.attendees', AttendeeController::class) 34 | ->scoped() 35 | ->only(['index', 'show']); -------------------------------------------------------------------------------- /event-management/routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 8 | })->purpose('Display an inspiring quote')->hourly(); 9 | -------------------------------------------------------------------------------- /event-management/routes/web.php: -------------------------------------------------------------------------------- 1 | get('/'); 16 | 17 | $response->assertStatus(200); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /event-management/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /event-management/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | laravel({ 7 | input: ['resources/css/app.css', 'resources/js/app.js'], 8 | refresh: true, 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /job-board/.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 | -------------------------------------------------------------------------------- /job-board/.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_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 | -------------------------------------------------------------------------------- /job-board/.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 | -------------------------------------------------------------------------------- /job-board/.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 | -------------------------------------------------------------------------------- /job-board/README.md: -------------------------------------------------------------------------------- 1 | # Job Portal Application 2 | 3 | This is a job portal application built using Laravel 11 and PHP 8.3. It allows employers to create job postings and users to apply for those jobs. The application includes features such as user authentication, job posting, job application, and employer management. 4 | 5 | ## Installation 6 | 7 | 1. Clone the repository: `git clone https://github.com/your-username/job-portal.git` 8 | 2. Install dependencies: `composer install` 9 | 3. Run migrations: `php artisan migrate` 10 | 4. Seed the database: `php artisan db:seed` 11 | 5. Start the server: `php artisan serve` 12 | 13 | ## Features 14 | 15 | * User authentication with email verification 16 | * Job posting with details such as title, description, and salary range 17 | * Job application with expected salary and status tracking 18 | * Employer management with company name and user association 19 | * Secure password hashing and verification 20 | 21 | ## Technologies Used 22 | 23 | * Laravel 11 24 | * PHP 8.3 25 | * MySQL (or any other database supported by Laravel) -------------------------------------------------------------------------------- /job-board/app/Http/Controllers/AuthController.php: -------------------------------------------------------------------------------- 1 | validate([ 18 | 'email' => 'required|email', 19 | 'password' => 'required' 20 | ]); 21 | 22 | $credentials = $request->only('email', 'password'); 23 | $remember = $request->filled('remember'); 24 | 25 | if (Auth::attempt($credentials, $remember)) { 26 | return redirect()->intended('/'); 27 | } else { 28 | return redirect()->back() 29 | ->with('error', 'Invalid credentials'); 30 | } 31 | } 32 | 33 | public function destroy() 34 | { 35 | Auth::logout(); 36 | 37 | request()->session()->invalidate(); 38 | request()->session()->regenerateToken(); 39 | 40 | return redirect('/'); 41 | } 42 | } -------------------------------------------------------------------------------- /job-board/app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | user()->employer()->create( 21 | $request->validate([ 22 | 'company_name' => 'required|min:3|unique:employers,company_name' 23 | ]) 24 | ); 25 | 26 | return redirect()->route('jobs.index') 27 | ->with('success', 'Your employer account was created!'); 28 | } 29 | } -------------------------------------------------------------------------------- /job-board/app/Http/Controllers/JobApplicationController.php: -------------------------------------------------------------------------------- 1 | $job]); 15 | } 16 | 17 | public function store(Job $job, Request $request) 18 | { 19 | Gate::authorize('apply', $job); 20 | 21 | $validatedData = $request->validate([ 22 | 'expected_salary' => 'required|min:1|max:1000000', 23 | 'cv' => 'required|file|mimes:pdf|max:2048' 24 | ]); 25 | 26 | $file = $request->file('cv'); 27 | $path = $file->store('cvs', 'local'); 28 | 29 | $job->jobApplications()->create([ 30 | 'user_id' => $request->user()->id, 31 | 'expected_salary' => $validatedData['expected_salary'], 32 | 'cv_path' => $path 33 | ]); 34 | 35 | return redirect()->route('jobs.show', $job) 36 | ->with('success', 'Job application submitted.'); 37 | } 38 | 39 | public function destroy(string $id) 40 | { 41 | // 42 | } 43 | } -------------------------------------------------------------------------------- /job-board/app/Http/Controllers/JobController.php: -------------------------------------------------------------------------------- 1 | only( 17 | 'search', 18 | 'min_salary', 19 | 'max_salary', 20 | 'experience', 21 | 'category' 22 | ); 23 | 24 | return view( 25 | 'job.index', 26 | ['jobs' => Job::with('employer')->latest()->filter($filters)->get()] 27 | ); 28 | } 29 | 30 | /** 31 | * Display the specified resource. 32 | */ 33 | public function show(Job $job) 34 | { 35 | Gate::authorize('view', $job); 36 | return view( 37 | 'job.show', 38 | ['job' => $job->load('employer.jobs')] 39 | ); 40 | } 41 | } -------------------------------------------------------------------------------- /job-board/app/Http/Controllers/MyJobApplicationController.php: -------------------------------------------------------------------------------- 1 | auth()->user()->jobApplications() 16 | ->with([ 17 | 'job' => fn($query) => $query->withCount('jobApplications') 18 | ->withAvg('jobApplications', 'expected_salary') 19 | ->withTrashed(), 20 | 'job.employer' 21 | ]) 22 | ->latest()->get() 23 | ] 24 | ); 25 | } 26 | 27 | public function destroy(JobApplication $myJobApplication) 28 | { 29 | $myJobApplication->delete(); 30 | 31 | return redirect()->back()->with( 32 | 'success', 33 | 'Job application removed.' 34 | ); 35 | } 36 | } -------------------------------------------------------------------------------- /job-board/app/Http/Middleware/Employer.php: -------------------------------------------------------------------------------- 1 | user() || null === $request->user()->employer) { 19 | return redirect()->route('employer.create') 20 | ->with('error', 'You need to register as an employer first!'); 21 | } 22 | 23 | return $next($request); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /job-board/app/Http/Requests/JobRequest.php: -------------------------------------------------------------------------------- 1 | 22 | */ 23 | public function rules(): array 24 | { 25 | return [ 26 | 'title' => 'required|string|max:255', 27 | 'location' => 'required|string|max:255', 28 | 'salary' => 'required|numeric|min:5000', 29 | 'description' => 'required|string', 30 | 'experience' => 'required|in:' . implode(',', Job::$experience), 31 | 'category' => 'required|in:' . implode(',', Job::$category) 32 | ]; 33 | } 34 | } -------------------------------------------------------------------------------- /job-board/app/Models/Employer.php: -------------------------------------------------------------------------------- 1 | hasMany(Job::class); 19 | } 20 | 21 | public function user(): BelongsTo 22 | { 23 | return $this->belongsTo(User::class); 24 | } 25 | } -------------------------------------------------------------------------------- /job-board/app/Models/JobApplication.php: -------------------------------------------------------------------------------- 1 | belongsTo(Job::class); 18 | } 19 | 20 | public function user(): BelongsTo 21 | { 22 | return $this->belongsTo(User::class); 23 | } 24 | } -------------------------------------------------------------------------------- /job-board/app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'entry', 'senior'] 20 | // 0, 1 21 | 22 | // ['Entry' => 'entry', 'Senior' => 'senior'] 23 | ) { 24 | // 25 | } 26 | 27 | public function optionsWithLabels(): array 28 | { 29 | return array_is_list($this->options) ? 30 | array_combine($this->options, $this->options) 31 | : $this->options; 32 | } 33 | 34 | /** 35 | * Get the view / contents that represent the component. 36 | */ 37 | public function render(): View|Closure|string 38 | { 39 | return view('components.radio-group'); 40 | } 41 | } -------------------------------------------------------------------------------- /job-board/app/View/Components/TextInput.php: -------------------------------------------------------------------------------- 1 | handleCommand(new ArgvInput); 14 | 15 | exit($status); 16 | -------------------------------------------------------------------------------- /job-board/bootstrap/app.php: -------------------------------------------------------------------------------- 1 | withRouting( 9 | web: __DIR__ . '/../routes/web.php', 10 | commands: __DIR__ . '/../routes/console.php', 11 | health: '/up', 12 | ) 13 | ->withMiddleware(function (Middleware $middleware) { 14 | $middleware->alias([ 15 | 'employer' => \App\Http\Middleware\Employer::class, 16 | ]); 17 | }) 18 | ->withExceptions(function (Exceptions $exceptions) { 19 | // 20 | })->create(); 21 | -------------------------------------------------------------------------------- /job-board/bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /job-board/bootstrap/providers.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 | -------------------------------------------------------------------------------- /job-board/database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /job-board/database/factories/EmployerFactory.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | class EmployerFactory extends Factory 11 | { 12 | /** 13 | * Define the model's default state. 14 | * 15 | * @return array 16 | */ 17 | public function definition(): array 18 | { 19 | return [ 20 | 'company_name' => fake()->company 21 | ]; 22 | } 23 | } -------------------------------------------------------------------------------- /job-board/database/factories/JobApplicationFactory.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | class JobApplicationFactory extends Factory 11 | { 12 | /** 13 | * Define the model's default state. 14 | * 15 | * @return array 16 | */ 17 | public function definition(): array 18 | { 19 | return [ 20 | 'expected_salary' => fake()->numberBetween(4_000, 170_000) 21 | ]; 22 | } 23 | } -------------------------------------------------------------------------------- /job-board/database/factories/JobFactory.php: -------------------------------------------------------------------------------- 1 | 10 | */ 11 | class JobFactory extends Factory 12 | { 13 | /** 14 | * Define the model's default state. 15 | * 16 | * @return array 17 | */ 18 | public function definition(): array 19 | { 20 | return [ 21 | 'title' => fake()->jobTitle, 22 | 'description' => fake()->paragraphs(3, true), 23 | 'salary' => fake()->numberBetween(5_000, 150_000), 24 | 'location' => fake()->city, 25 | 'category' => fake()->randomElement(Job::$category), 26 | 'experience' => fake()->randomElement(Job::$experience) 27 | ]; 28 | } 29 | } -------------------------------------------------------------------------------- /job-board/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 | -------------------------------------------------------------------------------- /job-board/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 | -------------------------------------------------------------------------------- /job-board/database/migrations/2023_05_15_152938_create_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | 17 | $table->string('title'); 18 | $table->text('description'); 19 | $table->unsignedInteger('salary'); 20 | $table->string('location'); 21 | $table->string('category'); 22 | $table->enum('experience', Job::$experience); 23 | 24 | $table->timestamps(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | */ 31 | public function down(): void 32 | { 33 | Schema::dropIfExists('offered_jobs'); 34 | } 35 | }; -------------------------------------------------------------------------------- /job-board/database/migrations/2023_05_25_165601_create_employers_table.php: -------------------------------------------------------------------------------- 1 | id(); 15 | 16 | $table->string('company_name'); 17 | $table->foreignIdFor(\App\Models\User::class) 18 | ->nullable()->constrained(); 19 | 20 | $table->timestamps(); 21 | }); 22 | 23 | Schema::table('offered_jobs', function (Blueprint $table) { 24 | $table->foreignIdFor(\App\Models\Employer::class)->constrained(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | */ 31 | public function down(): void 32 | { 33 | Schema::table('offered_jobs', function (Blueprint $table) { 34 | $table->dropForeignIdFor(\App\Models\Employer::class); 35 | }); 36 | 37 | Schema::dropIfExists('employers'); 38 | } 39 | }; -------------------------------------------------------------------------------- /job-board/database/migrations/2023_05_30_155859_create_job_applications_table.php: -------------------------------------------------------------------------------- 1 | id(); 15 | 16 | $table->foreignIdFor(\App\Models\User::class)->constrained(); 17 | $table->foreignIdFor(\App\Models\Job::class)->constrained(); 18 | 19 | $table->unsignedInteger('expected_salary'); 20 | 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('job_applications'); 31 | } 32 | }; -------------------------------------------------------------------------------- /job-board/database/migrations/2023_06_19_144746_add_cv_path_to_job_applications_table.php: -------------------------------------------------------------------------------- 1 | string('cv_path')->nullable(); 15 | }); 16 | } 17 | 18 | /** 19 | * Reverse the migrations. 20 | */ 21 | public function down(): void 22 | { 23 | Schema::table('job_applications', function (Blueprint $table) { 24 | $table->dropColumn('cv_path'); 25 | }); 26 | } 27 | }; -------------------------------------------------------------------------------- /job-board/database/migrations/2023_06_29_154702_add_soft_deletes_to_jobs_table.php: -------------------------------------------------------------------------------- 1 | softDeletes(); 15 | }); 16 | } 17 | 18 | /** 19 | * Reverse the migrations. 20 | */ 21 | public function down(): void 22 | { 23 | Schema::table('offered_jobs', function (Blueprint $table) { 24 | $table->dropSoftDeletes(); 25 | }); 26 | } 27 | }; -------------------------------------------------------------------------------- /job-board/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "type": "module", 4 | "scripts": { 5 | "build": "vite build", 6 | "dev": "vite" 7 | }, 8 | "devDependencies": { 9 | "autoprefixer": "^10.4.20", 10 | "axios": "^1.7.4", 11 | "concurrently": "^9.0.1", 12 | "laravel-vite-plugin": "^1.0", 13 | "postcss": "^8.4.47", 14 | "tailwindcss": "^3.4.13", 15 | "vite": "^5.0" 16 | }, 17 | "dependencies": { 18 | "alpinejs": "^3.14.3" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /job-board/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 | -------------------------------------------------------------------------------- /job-board/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /job-board/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 | -------------------------------------------------------------------------------- /job-board/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piotr-jura-udemy/laravel-course-2023/fdcc0332d2f6be0d732f73f0aace4a3913b52945/job-board/public/favicon.ico -------------------------------------------------------------------------------- /job-board/public/index.php: -------------------------------------------------------------------------------- 1 | handleRequest(Request::capture()); 18 | -------------------------------------------------------------------------------- /job-board/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /job-board/resources/css/app.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /job-board/resources/js/app.js: -------------------------------------------------------------------------------- 1 | import './bootstrap'; 2 | -------------------------------------------------------------------------------- /job-board/resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | import Alpine from 'alpinejs'; 3 | 4 | window.axios = axios; 5 | window.Alpine = Alpine; 6 | Alpine.start(); 7 | 8 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 9 | -------------------------------------------------------------------------------- /job-board/resources/views/auth/create.blade.php: -------------------------------------------------------------------------------- 1 | 2 |

    3 | Sign in to your account 4 |

    5 | 6 | 7 |
    8 | @csrf 9 | 10 |
    11 | E-mail 12 | 13 |
    14 | 15 |
    16 | 17 | Password 18 | 19 | 20 |
    21 | 22 |
    23 |
    24 |
    25 | 27 | 28 |
    29 |
    30 | 35 |
    36 | 37 | Login 38 |
    39 |
    40 |
    41 | -------------------------------------------------------------------------------- /job-board/resources/views/components/breadcrumbs.blade.php: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /job-board/resources/views/components/button.blade.php: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /job-board/resources/views/components/card.blade.php: -------------------------------------------------------------------------------- 1 |
    class(['rounded-md border border-slate-300 bg-white p-4 shadow-sm']) }}> 3 | {{ $slot }} 4 |
    5 | -------------------------------------------------------------------------------- /job-board/resources/views/components/job-card.blade.php: -------------------------------------------------------------------------------- 1 | 2 |
    3 |

    {{ $job->title }}

    4 |
    5 | ${{ number_format($job->salary) }} 6 |
    7 |
    8 | 9 |
    10 |
    11 |
    {{ $job->employer->company_name }}
    12 |
    {{ $job->location }}
    13 | @if ($job->deleted_at) 14 | Deleted 15 | @endif 16 |
    17 | 29 |
    30 | 31 | {{ $slot }} 32 |
    33 | -------------------------------------------------------------------------------- /job-board/resources/views/components/label.blade.php: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /job-board/resources/views/components/link-button.blade.php: -------------------------------------------------------------------------------- 1 | 3 | {{ $slot }} 4 | 5 | -------------------------------------------------------------------------------- /job-board/resources/views/components/radio-group.blade.php: -------------------------------------------------------------------------------- 1 |
    2 | @if ($allOption) 3 | 8 | @endif 9 | 10 | @foreach ($optionsWithLabels as $label => $option) 11 | 16 | @endforeach 17 | 18 | @error($name) 19 |
    20 | {{ $message }} 21 |
    22 | @enderror 23 |
    24 | -------------------------------------------------------------------------------- /job-board/resources/views/components/tag.blade.php: -------------------------------------------------------------------------------- 1 |
    2 | {{ $slot }} 3 |
    4 | -------------------------------------------------------------------------------- /job-board/resources/views/employer/create.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
    4 | @csrf 5 |
    6 | Company Name 7 | 8 |
    9 | 10 | Create 11 |
    12 |
    13 |
    14 | -------------------------------------------------------------------------------- /job-board/resources/views/job_application/create.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 |

    13 | Your Job Application 14 |

    15 | 16 |
    18 | @csrf 19 |
    20 | Expected Salary 21 | 22 |
    23 | 24 |
    25 | Upload CV 26 | 27 |
    28 | 29 | Apply 30 |
    31 |
    32 |
    33 | -------------------------------------------------------------------------------- /job-board/routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 8 | })->purpose('Display an inspiring quote')->hourly(); 9 | -------------------------------------------------------------------------------- /job-board/routes/web.php: -------------------------------------------------------------------------------- 1 | to_route('jobs.index')); 12 | 13 | Route::resource('jobs', JobController::class) 14 | ->only(['index', 'show']); 15 | 16 | Route::get('login', fn() => to_route('auth.create')) 17 | ->name('login'); 18 | Route::resource('auth', AuthController::class) 19 | ->only(['create', 'store']); 20 | Route::delete('logout', fn() => to_route('auth.destroy')) 21 | ->name('logout'); 22 | Route::delete('auth', [AuthController::class, 'destroy']) 23 | ->name('auth.destroy'); 24 | 25 | Route::middleware('auth')->group(function () { 26 | Route::resource('job.application', JobApplicationController::class) 27 | ->only(['create', 'store']); 28 | 29 | Route::resource('my-job-applications', MyJobApplicationController::class) 30 | ->only(['index', 'destroy']); 31 | 32 | Route::resource('employer', EmployerController::class) 33 | ->only(['create', 'store']); 34 | 35 | Route::middleware('employer') 36 | ->resource('my-jobs', MyJobController::class); 37 | }); -------------------------------------------------------------------------------- /job-board/storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !private/ 3 | !public/ 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /job-board/storage/app/private/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /job-board/storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /job-board/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 | -------------------------------------------------------------------------------- /job-board/storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /job-board/storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /job-board/storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /job-board/storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /job-board/storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /job-board/storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /job-board/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 | }; 21 | -------------------------------------------------------------------------------- /job-board/tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 16 | 17 | $response->assertStatus(200); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /job-board/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /job-board/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | laravel({ 7 | input: ['resources/css/app.css', 'resources/js/app.js'], 8 | refresh: true, 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /l10-task-list-resources/task-list.php: -------------------------------------------------------------------------------- 1 | 'required|max:255', 18 | 'description' => 'required', 19 | 'long_description' => 'required' 20 | ]; 21 | } 22 | } -------------------------------------------------------------------------------- /l10-task-list/app/Models/Task.php: -------------------------------------------------------------------------------- 1 | completed = !$this->completed; 17 | $this->save(); 18 | } 19 | } -------------------------------------------------------------------------------- /l10-task-list/app/Models/User.php: -------------------------------------------------------------------------------- 1 | */ 13 | use HasFactory, Notifiable; 14 | 15 | /** 16 | * The attributes that are mass assignable. 17 | * 18 | * @var array 19 | */ 20 | protected $fillable = [ 21 | 'name', 22 | 'email', 23 | 'password', 24 | ]; 25 | 26 | /** 27 | * The attributes that should be hidden for serialization. 28 | * 29 | * @var array 30 | */ 31 | protected $hidden = [ 32 | 'password', 33 | 'remember_token', 34 | ]; 35 | 36 | /** 37 | * Get the attributes that should be cast. 38 | * 39 | * @return array 40 | */ 41 | protected function casts(): array 42 | { 43 | return [ 44 | 'email_verified_at' => 'datetime', 45 | 'password' => 'hashed', 46 | ]; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /l10-task-list/app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | handleCommand(new ArgvInput); 14 | 15 | exit($status); 16 | -------------------------------------------------------------------------------- /l10-task-list/bootstrap/app.php: -------------------------------------------------------------------------------- 1 | withRouting( 9 | web: __DIR__.'/../routes/web.php', 10 | commands: __DIR__.'/../routes/console.php', 11 | health: '/up', 12 | ) 13 | ->withMiddleware(function (Middleware $middleware) { 14 | // 15 | }) 16 | ->withExceptions(function (Exceptions $exceptions) { 17 | // 18 | })->create(); 19 | -------------------------------------------------------------------------------- /l10-task-list/bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /l10-task-list/bootstrap/providers.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 | -------------------------------------------------------------------------------- /l10-task-list/database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /l10-task-list/database/factories/TaskFactory.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | class TaskFactory extends Factory 11 | { 12 | /** 13 | * Define the model's default state. 14 | * 15 | * @return array 16 | */ 17 | public function definition(): array 18 | { 19 | return [ 20 | 'title' => fake()->sentence, 21 | 'description' => fake()->paragraph, 22 | 'long_description' => fake()->paragraph(7, true), 23 | 'completed' => fake()->boolean 24 | ]; 25 | } 26 | } -------------------------------------------------------------------------------- /l10-task-list/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 | -------------------------------------------------------------------------------- /l10-task-list/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 | -------------------------------------------------------------------------------- /l10-task-list/database/migrations/2023_03_28_162430_create_tasks_table.php: -------------------------------------------------------------------------------- 1 | id(); 15 | 16 | $table->string('title'); 17 | $table->text('description'); 18 | $table->text('long_description')->nullable(); 19 | $table->boolean('completed')->default(false); 20 | 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('tasks'); 31 | } 32 | }; -------------------------------------------------------------------------------- /l10-task-list/database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 18 | User::factory(2)->unverified()->create(); 19 | Task::factory(20)->create(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /l10-task-list/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "type": "module", 4 | "scripts": { 5 | "build": "vite build", 6 | "dev": "vite" 7 | }, 8 | "devDependencies": { 9 | "autoprefixer": "^10.4.20", 10 | "axios": "^1.7.4", 11 | "concurrently": "^9.0.1", 12 | "laravel-vite-plugin": "^1.0", 13 | "postcss": "^8.4.47", 14 | "tailwindcss": "^3.4.13", 15 | "vite": "^5.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /l10-task-list/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 | -------------------------------------------------------------------------------- /l10-task-list/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /l10-task-list/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 | -------------------------------------------------------------------------------- /l10-task-list/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piotr-jura-udemy/laravel-course-2023/fdcc0332d2f6be0d732f73f0aace4a3913b52945/l10-task-list/public/favicon.ico -------------------------------------------------------------------------------- /l10-task-list/public/index.php: -------------------------------------------------------------------------------- 1 | handleRequest(Request::capture()); 18 | -------------------------------------------------------------------------------- /l10-task-list/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /l10-task-list/resources/css/app.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /l10-task-list/resources/js/app.js: -------------------------------------------------------------------------------- 1 | import './bootstrap'; 2 | -------------------------------------------------------------------------------- /l10-task-list/resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | window.axios = axios; 3 | 4 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 5 | -------------------------------------------------------------------------------- /l10-task-list/resources/views/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | @include('form') 5 | @endsection 6 | -------------------------------------------------------------------------------- /l10-task-list/resources/views/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | @include('form', ['task' => $task]) 5 | @endsection 6 | -------------------------------------------------------------------------------- /l10-task-list/resources/views/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('title', 'The list of tasks') 4 | 5 | @section('content') 6 | 9 | 10 | @forelse ($tasks as $task) 11 | 15 | @empty 16 |
    There are no tasks!
    17 | @endforelse 18 | 19 | @if ($tasks->count()) 20 | 23 | @endif 24 | @endsection 25 | -------------------------------------------------------------------------------- /l10-task-list/routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 8 | })->purpose('Display an inspiring quote')->hourly(); 9 | -------------------------------------------------------------------------------- /l10-task-list/storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !private/ 3 | !public/ 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /l10-task-list/storage/app/private/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /l10-task-list/storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /l10-task-list/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 | -------------------------------------------------------------------------------- /l10-task-list/storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /l10-task-list/storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /l10-task-list/storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /l10-task-list/storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /l10-task-list/storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /l10-task-list/storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /l10-task-list/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 | }; 21 | -------------------------------------------------------------------------------- /l10-task-list/tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 16 | 17 | $response->assertStatus(200); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /l10-task-list/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /l10-task-list/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | laravel({ 7 | input: ['resources/css/app.css', 'resources/js/app.js'], 8 | refresh: true, 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /livewire-poll-resources/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Laravel Livewire Poll 8 | 9 | 10 | 11 | {{-- blade-formatter-disable --}} 12 | 30 | {{-- blade-formatter-enable --}} 31 | 32 | @livewireStyles 33 | 34 | 35 | 36 | @livewireScripts 37 | 38 | 39 | -------------------------------------------------------------------------------- /livewire-poll/.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 | -------------------------------------------------------------------------------- /livewire-poll/.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_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 | -------------------------------------------------------------------------------- /livewire-poll/.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 | -------------------------------------------------------------------------------- /livewire-poll/.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 | -------------------------------------------------------------------------------- /livewire-poll/README.md: -------------------------------------------------------------------------------- 1 | # Polls Application 2 | 3 | This is a simple polls application built using Laravel and Livewire. It allows users to create polls and vote on them. 4 | 5 | ## Features 6 | 7 | * Create polls with multiple options 8 | * Vote on polls 9 | * View latest polls with their options and vote counts 10 | 11 | ## Installation 12 | 13 | 1. Clone the repository 14 | 2. Run `composer install` to install dependencies 15 | 3. Run `php artisan migrate` to migrate the database 16 | 4. Run `php artisan serve` to start the server 17 | 18 | ## Usage 19 | 20 | 1. Open the application in your browser 21 | 2. Click on "Create Poll" to create a new poll 22 | 3. Fill in the poll title and options 23 | 4. Submit the form to create the poll 24 | 5. Vote on the poll by clicking on an option 25 | 6. View the latest polls and their vote counts on the homepage 26 | -------------------------------------------------------------------------------- /livewire-poll/app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | 'render' 13 | // ]; 14 | #[On('pollCreated')] 15 | public function render() 16 | { 17 | $polls = \App\Models\Poll::with('options.votes') 18 | ->latest()->get(); 19 | 20 | return view('livewire.polls', ['polls' => $polls]); 21 | } 22 | 23 | public function vote(Option $option) 24 | { 25 | $option->votes()->create(); 26 | } 27 | } -------------------------------------------------------------------------------- /livewire-poll/app/Models/Option.php: -------------------------------------------------------------------------------- 1 | belongsTo(Poll::class); 19 | } 20 | 21 | public function votes(): HasMany 22 | { 23 | return $this->hasMany(Vote::class); 24 | } 25 | } -------------------------------------------------------------------------------- /livewire-poll/app/Models/Poll.php: -------------------------------------------------------------------------------- 1 | hasMany(Option::class); 18 | } 19 | } -------------------------------------------------------------------------------- /livewire-poll/app/Models/User.php: -------------------------------------------------------------------------------- 1 | */ 13 | use HasFactory, Notifiable; 14 | 15 | /** 16 | * The attributes that are mass assignable. 17 | * 18 | * @var array 19 | */ 20 | protected $fillable = [ 21 | 'name', 22 | 'email', 23 | 'password', 24 | ]; 25 | 26 | /** 27 | * The attributes that should be hidden for serialization. 28 | * 29 | * @var array 30 | */ 31 | protected $hidden = [ 32 | 'password', 33 | 'remember_token', 34 | ]; 35 | 36 | /** 37 | * Get the attributes that should be cast. 38 | * 39 | * @return array 40 | */ 41 | protected function casts(): array 42 | { 43 | return [ 44 | 'email_verified_at' => 'datetime', 45 | 'password' => 'hashed', 46 | ]; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /livewire-poll/app/Models/Vote.php: -------------------------------------------------------------------------------- 1 | belongsTo(Option::class); 16 | } 17 | } -------------------------------------------------------------------------------- /livewire-poll/app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | handleCommand(new ArgvInput); 14 | 15 | exit($status); 16 | -------------------------------------------------------------------------------- /livewire-poll/bootstrap/app.php: -------------------------------------------------------------------------------- 1 | withRouting( 9 | web: __DIR__.'/../routes/web.php', 10 | commands: __DIR__.'/../routes/console.php', 11 | health: '/up', 12 | ) 13 | ->withMiddleware(function (Middleware $middleware) { 14 | // 15 | }) 16 | ->withExceptions(function (Exceptions $exceptions) { 17 | // 18 | })->create(); 19 | -------------------------------------------------------------------------------- /livewire-poll/bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /livewire-poll/bootstrap/providers.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 | -------------------------------------------------------------------------------- /livewire-poll/database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /livewire-poll/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 | -------------------------------------------------------------------------------- /livewire-poll/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 | -------------------------------------------------------------------------------- /livewire-poll/database/migrations/2023_05_10_171604_create_polls_table.php: -------------------------------------------------------------------------------- 1 | id(); 15 | $table->string('title'); 16 | $table->timestamps(); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | */ 23 | public function down(): void 24 | { 25 | Schema::dropIfExists('polls'); 26 | } 27 | }; -------------------------------------------------------------------------------- /livewire-poll/database/migrations/2023_05_10_171605_create_options_table.php: -------------------------------------------------------------------------------- 1 | id(); 15 | $table->string('name'); 16 | $table->timestamps(); 17 | 18 | $table->foreignIdFor(\App\Models\Poll::class)->constrained(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | */ 25 | public function down(): void 26 | { 27 | Schema::dropIfExists('options'); 28 | } 29 | }; -------------------------------------------------------------------------------- /livewire-poll/database/migrations/2023_05_10_171618_create_votes_table.php: -------------------------------------------------------------------------------- 1 | id(); 15 | $table->timestamps(); 16 | 17 | $table->foreignIdFor(\App\Models\Option::class)->constrained(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | */ 24 | public function down(): void 25 | { 26 | Schema::dropIfExists('votes'); 27 | } 28 | }; -------------------------------------------------------------------------------- /livewire-poll/database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 17 | 18 | User::factory()->create([ 19 | 'name' => 'Test User', 20 | 'email' => 'test@example.com', 21 | ]); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /livewire-poll/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "type": "module", 4 | "scripts": { 5 | "build": "vite build", 6 | "dev": "vite" 7 | }, 8 | "devDependencies": { 9 | "autoprefixer": "^10.4.20", 10 | "axios": "^1.7.4", 11 | "concurrently": "^9.0.1", 12 | "laravel-vite-plugin": "^1.0", 13 | "postcss": "^8.4.47", 14 | "tailwindcss": "^3.4.13", 15 | "vite": "^5.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /livewire-poll/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 | -------------------------------------------------------------------------------- /livewire-poll/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /livewire-poll/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 | -------------------------------------------------------------------------------- /livewire-poll/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piotr-jura-udemy/laravel-course-2023/fdcc0332d2f6be0d732f73f0aace4a3913b52945/livewire-poll/public/favicon.ico -------------------------------------------------------------------------------- /livewire-poll/public/index.php: -------------------------------------------------------------------------------- 1 | handleRequest(Request::capture()); 18 | -------------------------------------------------------------------------------- /livewire-poll/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /livewire-poll/resources/css/app.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /livewire-poll/resources/js/app.js: -------------------------------------------------------------------------------- 1 | import './bootstrap'; 2 | -------------------------------------------------------------------------------- /livewire-poll/resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | window.axios = axios; 3 | 4 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 5 | -------------------------------------------------------------------------------- /livewire-poll/resources/views/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Laravel Livewire Poll 8 | 9 | 10 | 11 | {{-- blade-formatter-disable --}} 12 | 30 | {{-- blade-formatter-enable --}} 31 | 32 | @livewireStyles 33 | 34 | 35 | 36 | @livewireScripts 37 | 38 |
    39 |

    Create Poll

    40 | @livewire('create-poll') 41 |
    42 | 43 |
    44 |

    Available Polls

    45 | @livewire('polls') 46 |
    47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /livewire-poll/resources/views/livewire/create-poll.blade.php: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | 4 | 5 | 6 | 7 | @error('title') 8 |
    {{ $message }}
    9 | @enderror 10 | 11 |
    12 | 13 |
    14 | 15 |
    16 | @foreach ($options as $index => $option) 17 |
    18 | 19 |
    20 | 21 | 23 |
    24 | @error("options.{$index}") 25 |
    {{ $message }}
    26 | @enderror 27 |
    28 | @endforeach 29 |
    30 | 31 | 32 |
    33 |
    34 | -------------------------------------------------------------------------------- /livewire-poll/resources/views/livewire/polls.blade.php: -------------------------------------------------------------------------------- 1 |
    2 | @forelse ($polls as $poll) 3 |
    4 |

    5 | {{ $poll->title }} 6 |

    7 | @foreach ($poll->options as $option) 8 |
    9 | 10 | {{ $option->name }} ({{ $option->votes->count() }}) 11 |
    12 | @endforeach 13 |
    14 | @empty 15 |
    16 | No polls available 17 |
    18 | @endforelse 19 |
    20 | -------------------------------------------------------------------------------- /livewire-poll/routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 8 | })->purpose('Display an inspiring quote')->hourly(); 9 | -------------------------------------------------------------------------------- /livewire-poll/routes/web.php: -------------------------------------------------------------------------------- 1 | get('/'); 16 | 17 | $response->assertStatus(200); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /livewire-poll/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /livewire-poll/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | laravel({ 7 | input: ['resources/css/app.css', 'resources/js/app.js'], 8 | refresh: true, 9 | }), 10 | ], 11 | }); 12 | -------------------------------------------------------------------------------- /task-list/.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 | -------------------------------------------------------------------------------- /task-list/.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_TIMEZONE=UTC 6 | APP_URL=http://localhost 7 | 8 | APP_LOCALE=en 9 | APP_FALLBACK_LOCALE=en 10 | APP_FAKER_LOCALE=en_US 11 | 12 | APP_MAINTENANCE_DRIVER=file 13 | # APP_MAINTENANCE_STORE=database 14 | 15 | BCRYPT_ROUNDS=12 16 | 17 | LOG_CHANNEL=stack 18 | LOG_STACK=single 19 | LOG_DEPRECATIONS_CHANNEL=null 20 | LOG_LEVEL=debug 21 | 22 | DB_CONNECTION=sqlite 23 | # DB_HOST=127.0.0.1 24 | # DB_PORT=3306 25 | # DB_DATABASE=laravel 26 | # DB_USERNAME=root 27 | # DB_PASSWORD= 28 | 29 | SESSION_DRIVER=database 30 | SESSION_LIFETIME=120 31 | SESSION_ENCRYPT=false 32 | SESSION_PATH=/ 33 | SESSION_DOMAIN=null 34 | 35 | BROADCAST_CONNECTION=log 36 | FILESYSTEM_DISK=local 37 | QUEUE_CONNECTION=database 38 | 39 | CACHE_STORE=database 40 | CACHE_PREFIX= 41 | 42 | MEMCACHED_HOST=127.0.0.1 43 | 44 | REDIS_CLIENT=phpredis 45 | REDIS_HOST=127.0.0.1 46 | REDIS_PASSWORD=null 47 | REDIS_PORT=6379 48 | 49 | MAIL_MAILER=log 50 | MAIL_HOST=127.0.0.1 51 | MAIL_PORT=2525 52 | MAIL_USERNAME=null 53 | MAIL_PASSWORD=null 54 | MAIL_ENCRYPTION=null 55 | MAIL_FROM_ADDRESS="hello@example.com" 56 | MAIL_FROM_NAME="${APP_NAME}" 57 | 58 | AWS_ACCESS_KEY_ID= 59 | AWS_SECRET_ACCESS_KEY= 60 | AWS_DEFAULT_REGION=us-east-1 61 | AWS_BUCKET= 62 | AWS_USE_PATH_STYLE_ENDPOINT=false 63 | 64 | VITE_APP_NAME="${APP_NAME}" 65 | -------------------------------------------------------------------------------- /task-list/.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 | -------------------------------------------------------------------------------- /task-list/.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 | .phpactor.json 12 | .phpunit.result.cache 13 | Homestead.json 14 | Homestead.yaml 15 | auth.json 16 | npm-debug.log 17 | yarn-error.log 18 | /.fleet 19 | /.idea 20 | /.vscode 21 | /.zed 22 | -------------------------------------------------------------------------------- /task-list/app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | protected $fillable = [ 20 | 'name', 21 | 'email', 22 | 'password', 23 | ]; 24 | 25 | /** 26 | * The attributes that should be hidden for serialization. 27 | * 28 | * @var array 29 | */ 30 | protected $hidden = [ 31 | 'password', 32 | 'remember_token', 33 | ]; 34 | 35 | /** 36 | * Get the attributes that should be cast. 37 | * 38 | * @return array 39 | */ 40 | protected function casts(): array 41 | { 42 | return [ 43 | 'email_verified_at' => 'datetime', 44 | 'password' => 'hashed', 45 | ]; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /task-list/app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | handleCommand(new ArgvInput); 14 | 15 | exit($status); 16 | -------------------------------------------------------------------------------- /task-list/bootstrap/app.php: -------------------------------------------------------------------------------- 1 | withRouting( 9 | web: __DIR__.'/../routes/web.php', 10 | commands: __DIR__.'/../routes/console.php', 11 | health: '/up', 12 | ) 13 | ->withMiddleware(function (Middleware $middleware) { 14 | // 15 | }) 16 | ->withExceptions(function (Exceptions $exceptions) { 17 | // 18 | })->create(); 19 | -------------------------------------------------------------------------------- /task-list/bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /task-list/bootstrap/providers.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 | -------------------------------------------------------------------------------- /task-list/database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /task-list/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 | -------------------------------------------------------------------------------- /task-list/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 | -------------------------------------------------------------------------------- /task-list/database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 17 | 18 | User::factory()->create([ 19 | 'name' => 'Test User', 20 | 'email' => 'test@example.com', 21 | ]); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /task-list/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "type": "module", 4 | "scripts": { 5 | "dev": "vite", 6 | "build": "vite build" 7 | }, 8 | "devDependencies": { 9 | "axios": "^1.7.4", 10 | "laravel-vite-plugin": "^1.0", 11 | "vite": "^5.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /task-list/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 | -------------------------------------------------------------------------------- /task-list/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 | -------------------------------------------------------------------------------- /task-list/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piotr-jura-udemy/laravel-course-2023/fdcc0332d2f6be0d732f73f0aace4a3913b52945/task-list/public/favicon.ico -------------------------------------------------------------------------------- /task-list/public/index.php: -------------------------------------------------------------------------------- 1 | handleRequest(Request::capture()); 18 | -------------------------------------------------------------------------------- /task-list/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /task-list/resources/css/app.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piotr-jura-udemy/laravel-course-2023/fdcc0332d2f6be0d732f73f0aace4a3913b52945/task-list/resources/css/app.css -------------------------------------------------------------------------------- /task-list/resources/js/app.js: -------------------------------------------------------------------------------- 1 | import './bootstrap'; 2 | -------------------------------------------------------------------------------- /task-list/resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | window.axios = axios; 3 | 4 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 5 | -------------------------------------------------------------------------------- /task-list/routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 8 | })->purpose('Display an inspiring quote')->hourly(); 9 | -------------------------------------------------------------------------------- /task-list/routes/web.php: -------------------------------------------------------------------------------- 1 | get('/'); 16 | 17 | $response->assertStatus(200); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /task-list/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /task-list/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | laravel({ 7 | input: ['resources/css/app.css', 'resources/js/app.js'], 8 | refresh: true, 9 | }), 10 | ], 11 | }); 12 | --------------------------------------------------------------------------------