├── public
├── favicon.ico
├── robots.txt
├── index.php
└── .htaccess
├── database
├── .gitignore
├── seeders
│ └── DatabaseSeeder.php
├── factories
│ ├── PodcastFactory.php
│ └── UserFactory.php
└── migrations
│ ├── 2024_03_12_161736_create_podcasts_table.php
│ ├── 0001_01_01_000001_create_cache_table.php
│ ├── 0001_01_01_000000_create_users_table.php
│ └── 0001_01_01_000002_create_jobs_table.php
├── bootstrap
├── cache
│ └── .gitignore
├── providers.php
└── app.php
├── storage
├── logs
│ └── .gitignore
├── app
│ ├── public
│ │ └── .gitignore
│ └── .gitignore
└── framework
│ ├── testing
│ └── .gitignore
│ ├── views
│ └── .gitignore
│ ├── cache
│ ├── data
│ │ └── .gitignore
│ └── .gitignore
│ ├── sessions
│ └── .gitignore
│ └── .gitignore
├── resources
├── css
│ └── app.css
├── js
│ ├── Components
│ │ ├── InputError.vue
│ │ ├── InputLabel.vue
│ │ ├── DangerButton.vue
│ │ ├── PrimaryButton.vue
│ │ ├── DropdownLink.vue
│ │ ├── SecondaryButton.vue
│ │ ├── TextInput.vue
│ │ ├── Checkbox.vue
│ │ ├── NavLink.vue
│ │ ├── ResponsiveNavLink.vue
│ │ ├── SimplePagination.vue
│ │ ├── Notification.vue
│ │ ├── Dropdown.vue
│ │ ├── ApplicationLogo.vue
│ │ └── Modal.vue
│ ├── bootstrap.js
│ ├── echo.js
│ ├── Layouts
│ │ ├── GuestLayout.vue
│ │ └── AuthenticatedLayout.vue
│ ├── Pages
│ │ ├── Dashboard.vue
│ │ ├── Profile
│ │ │ ├── Edit.vue
│ │ │ └── Partials
│ │ │ │ ├── DeleteUserForm.vue
│ │ │ │ ├── UpdateProfileInformationForm.vue
│ │ │ │ └── UpdatePasswordForm.vue
│ │ ├── Auth
│ │ │ ├── ConfirmPassword.vue
│ │ │ ├── VerifyEmail.vue
│ │ │ ├── ForgotPassword.vue
│ │ │ ├── ResetPassword.vue
│ │ │ ├── Login.vue
│ │ │ └── Register.vue
│ │ ├── Podcasts
│ │ │ └── Index.vue
│ │ └── Welcome.vue
│ └── app.js
└── views
│ └── app.blade.php
├── tests
├── Unit
│ └── ExampleTest.php
├── Feature
│ ├── ExampleTest.php
│ ├── Auth
│ │ ├── RegistrationTest.php
│ │ ├── PasswordConfirmationTest.php
│ │ ├── AuthenticationTest.php
│ │ ├── PasswordUpdateTest.php
│ │ ├── EmailVerificationTest.php
│ │ └── PasswordResetTest.php
│ └── ProfileTest.php
├── TestCase.php
└── Pest.php
├── postcss.config.js
├── app
├── Http
│ ├── Controllers
│ │ ├── Controller.php
│ │ ├── Auth
│ │ │ ├── EmailVerificationPromptController.php
│ │ │ ├── EmailVerificationNotificationController.php
│ │ │ ├── PasswordController.php
│ │ │ ├── VerifyEmailController.php
│ │ │ ├── ConfirmablePasswordController.php
│ │ │ ├── AuthenticatedSessionController.php
│ │ │ ├── RegisteredUserController.php
│ │ │ ├── PasswordResetLinkController.php
│ │ │ └── NewPasswordController.php
│ │ └── ProfileController.php
│ ├── Requests
│ │ ├── ProfileUpdateRequest.php
│ │ └── Auth
│ │ │ └── LoginRequest.php
│ └── Middleware
│ │ └── HandleInertiaRequests.php
├── PodcastStatus.php
├── Providers
│ └── AppServiceProvider.php
├── Models
│ ├── Podcast.php
│ └── User.php
├── Events
│ └── PodcastPublished.php
├── Jobs
│ └── PublishPodcast.php
└── Notifications
│ └── PodcastPublished.php
├── routes
├── channels.php
├── console.php
├── web.php
└── auth.php
├── .gitattributes
├── jsconfig.json
├── .gitignore
├── .editorconfig
├── artisan
├── vite.config.js
├── tailwind.config.js
├── package.json
├── README.md
├── config
├── services.php
├── filesystems.php
├── reverb.php
├── broadcasting.php
├── mail.php
├── cache.php
├── queue.php
├── auth.php
├── app.php
├── logging.php
├── database.php
└── session.php
├── phpunit.xml
├── .env.example
└── composer.json
/public/favicon.ico:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite*
2 |
--------------------------------------------------------------------------------
/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/logs/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/storage/app/public/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/app/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !public/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/storage/framework/testing/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/views/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/cache/data/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/sessions/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !data/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/resources/css/app.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
--------------------------------------------------------------------------------
/bootstrap/providers.php:
--------------------------------------------------------------------------------
1 | toBeTrue();
5 | });
6 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | export default {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | };
7 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | get('/');
5 |
6 | $response->assertStatus(200);
7 | });
8 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/app/PodcastStatus.php:
--------------------------------------------------------------------------------
1 | id === (int) $id;
7 | });
8 |
--------------------------------------------------------------------------------
/tests/TestCase.php:
--------------------------------------------------------------------------------
1 |
2 | defineProps({
3 | message: {
4 | type: String,
5 | },
6 | });
7 |
8 |
9 |
10 |
11 |
12 | {{ message }}
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/resources/js/Components/InputLabel.vue:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 | {{ value }}
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | handleCommand(new ArgvInput);
14 |
15 | exit($status);
16 |
--------------------------------------------------------------------------------
/resources/js/Components/DangerButton.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/routes/console.php:
--------------------------------------------------------------------------------
1 | ', 0)->update([
10 | 'status' => PodcastStatus::Unpublished,
11 | 'published_at' => null,
12 | ]);
13 | })->purpose('Reset application state to the default.');
14 |
--------------------------------------------------------------------------------
/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 |
6 | /**
7 | * Echo exposes an expressive API for subscribing to channels and listening
8 | * for events that are broadcast by Laravel. Echo and event broadcasting
9 | * allow your team to quickly build robust real-time web applications.
10 | */
11 |
12 | import './echo';
13 |
--------------------------------------------------------------------------------
/resources/js/Components/PrimaryButton.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 |
2 | import { Link } from '@inertiajs/vue3';
3 |
4 | defineProps({
5 | href: {
6 | type: String,
7 | required: true,
8 | },
9 | });
10 |
11 |
12 |
13 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/resources/js/echo.js:
--------------------------------------------------------------------------------
1 | import Echo from 'laravel-echo';
2 |
3 | import Pusher from 'pusher-js';
4 | window.Pusher = Pusher;
5 |
6 | window.Echo = new Echo({
7 | broadcaster: 'reverb',
8 | key: import.meta.env.VITE_REVERB_APP_KEY,
9 | wsHost: import.meta.env.VITE_REVERB_HOST,
10 | wsPort: import.meta.env.VITE_REVERB_PORT ?? 80,
11 | wssPort: import.meta.env.VITE_REVERB_PORT ?? 443,
12 | forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https',
13 | enabledTransports: ['ws', 'wss'],
14 | });
15 |
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 | handleRequest(Request::capture());
18 |
--------------------------------------------------------------------------------
/vite.config.js:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 | import laravel from 'laravel-vite-plugin';
3 | import vue from '@vitejs/plugin-vue';
4 |
5 | export default defineConfig({
6 | plugins: [
7 | laravel({
8 | input: 'resources/js/app.js',
9 | refresh: true,
10 | }),
11 | vue({
12 | template: {
13 | transformAssetUrls: {
14 | base: null,
15 | includeAbsolute: false,
16 | },
17 | },
18 | }),
19 | ],
20 | });
21 |
--------------------------------------------------------------------------------
/tests/Feature/Auth/RegistrationTest.php:
--------------------------------------------------------------------------------
1 | get('/register');
5 |
6 | $response->assertStatus(200);
7 | });
8 |
9 | test('new users can register', function () {
10 | $response = $this->post('/register', [
11 | 'name' => 'Test User',
12 | 'email' => 'test@example.com',
13 | 'password' => 'password',
14 | 'password_confirmation' => 'password',
15 | ]);
16 |
17 | $this->assertAuthenticated();
18 | $response->assertRedirect(route('dashboard', absolute: false));
19 | });
20 |
--------------------------------------------------------------------------------
/database/seeders/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | create();
18 |
19 | User::factory()->has(Podcast::factory(30))->create([
20 | 'name' => 'Test User',
21 | 'email' => 'test@example.com',
22 | ]);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/resources/js/Components/SecondaryButton.vue:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/resources/js/Components/TextInput.vue:
--------------------------------------------------------------------------------
1 |
19 |
20 |
21 |
26 |
27 |
--------------------------------------------------------------------------------
/tailwind.config.js:
--------------------------------------------------------------------------------
1 | import defaultTheme from 'tailwindcss/defaultTheme';
2 | import forms from '@tailwindcss/forms';
3 |
4 | /** @type {import('tailwindcss').Config} */
5 | export default {
6 | content: [
7 | './vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
8 | './storage/framework/views/*.php',
9 | './resources/views/**/*.blade.php',
10 | './resources/js/**/*.vue',
11 | ],
12 |
13 | theme: {
14 | extend: {
15 | fontFamily: {
16 | sans: ['Figtree', ...defaultTheme.fontFamily.sans],
17 | },
18 | },
19 | },
20 |
21 | plugins: [forms],
22 | };
23 |
--------------------------------------------------------------------------------
/resources/js/Layouts/GuestLayout.vue:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
13 |
14 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "type": "module",
4 | "scripts": {
5 | "dev": "vite",
6 | "build": "vite build"
7 | },
8 | "devDependencies": {
9 | "@inertiajs/vue3": "^1.0.0",
10 | "@tailwindcss/forms": "^0.5.3",
11 | "@vitejs/plugin-vue": "^5.0.0",
12 | "autoprefixer": "^10.4.12",
13 | "axios": "^1.6.4",
14 | "laravel-echo": "^1.16.0",
15 | "laravel-vite-plugin": "^1.0",
16 | "postcss": "^8.4.31",
17 | "pusher-js": "^8.4.0-rc2",
18 | "tailwindcss": "^3.2.1",
19 | "vite": "^5.0",
20 | "vue": "^3.4.0"
21 | },
22 | "dependencies": {
23 | "@heroicons/vue": "^2.1.1"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/Http/Requests/ProfileUpdateRequest.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | public function rules(): array
17 | {
18 | return [
19 | 'name' => ['required', 'string', 'max:255'],
20 | 'email' => ['required', 'string', 'lowercase', 'email', 'max:255', Rule::unique(User::class)->ignore($this->user()->id)],
21 | ];
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/EmailVerificationPromptController.php:
--------------------------------------------------------------------------------
1 | user()->hasVerifiedEmail()
19 | ? redirect()->intended(route('dashboard', absolute: false))
20 | : Inertia::render('Auth/VerifyEmail', ['status' => session('status')]);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/EmailVerificationNotificationController.php:
--------------------------------------------------------------------------------
1 | user()->hasVerifiedEmail()) {
17 | return redirect()->intended(route('dashboard', absolute: false));
18 | }
19 |
20 | $request->user()->sendEmailVerificationNotification();
21 |
22 | return back()->with('status', 'verification-link-sent');
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/resources/js/Components/Checkbox.vue:
--------------------------------------------------------------------------------
1 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/resources/js/Pages/Dashboard.vue:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Dashboard
12 |
13 |
14 |
15 |
16 |
17 |
You're logged in!
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/resources/views/app.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{ config('app.name', 'Laravel') }}
8 |
9 |
10 |
11 |
12 |
13 |
14 | @routes
15 | @vite(['resources/js/app.js', "resources/js/Pages/{$page['component']}.vue"])
16 | @inertiaHead
17 |
18 |
19 | @inertia
20 |
21 |
22 |
--------------------------------------------------------------------------------
/database/factories/PodcastFactory.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class PodcastFactory extends Factory
13 | {
14 | /**
15 | * Define the model's default state.
16 | *
17 | * @return array
18 | */
19 | public function definition(): array
20 | {
21 | return [
22 | 'user_id' => User::factory(),
23 | 'name' => fake()->words(3, true),
24 | 'description' => fake()->paragraph,
25 | 'status' => PodcastStatus::Unpublished,
26 | 'published_at' => null,
27 | ];
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/resources/js/app.js:
--------------------------------------------------------------------------------
1 | import './bootstrap';
2 | import '../css/app.css';
3 |
4 | import { createApp, h } from 'vue';
5 | import { createInertiaApp } from '@inertiajs/vue3';
6 | import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
7 | import { ZiggyVue } from '../../vendor/tightenco/ziggy';
8 |
9 | const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
10 |
11 | createInertiaApp({
12 | title: (title) => `${title} - ${appName}`,
13 | resolve: (name) => resolvePageComponent(`./Pages/${name}.vue`, import.meta.glob('./Pages/**/*.vue')),
14 | setup({ el, App, props, plugin }) {
15 | return createApp({ render: () => h(App, props) })
16 | .use(plugin)
17 | .use(ZiggyVue)
18 | .mount(el);
19 | },
20 | progress: {
21 | color: '#4B5563',
22 | },
23 | });
24 |
--------------------------------------------------------------------------------
/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | withRouting(
9 | web: __DIR__.'/../routes/web.php',
10 | commands: __DIR__.'/../routes/console.php',
11 | channels: __DIR__.'/../routes/channels.php',
12 | health: '/up',
13 | )
14 | ->withMiddleware(function (Middleware $middleware) {
15 | $middleware->web(append: [
16 | \App\Http\Middleware\HandleInertiaRequests::class,
17 | \Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class,
18 | ]);
19 |
20 | //
21 | })
22 | ->withExceptions(function (Exceptions $exceptions) {
23 | //
24 | })->create();
25 |
--------------------------------------------------------------------------------
/app/Models/Podcast.php:
--------------------------------------------------------------------------------
1 | PodcastStatus::class,
21 | 'published_at' => 'datetime',
22 | ];
23 | }
24 |
25 | public function name(): Attribute
26 | {
27 | return Attribute::get(fn ($value) => str($value)->apa());
28 | }
29 |
30 | public function user(): BelongsTo
31 | {
32 | return $this->belongsTo(User::class);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/PasswordController.php:
--------------------------------------------------------------------------------
1 | validate([
19 | 'current_password' => ['required', 'current_password'],
20 | 'password' => ['required', Password::defaults(), 'confirmed'],
21 | ]);
22 |
23 | $request->user()->update([
24 | 'password' => Hash::make($validated['password']),
25 | ]);
26 |
27 | return back();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/VerifyEmailController.php:
--------------------------------------------------------------------------------
1 | user()->hasVerifiedEmail()) {
18 | return redirect()->intended(route('dashboard', absolute: false).'?verified=1');
19 | }
20 |
21 | if ($request->user()->markEmailAsVerified()) {
22 | event(new Verified($request->user()));
23 | }
24 |
25 | return redirect()->intended(route('dashboard', absolute: false).'?verified=1');
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/tests/Feature/Auth/PasswordConfirmationTest.php:
--------------------------------------------------------------------------------
1 | create();
7 |
8 | $response = $this->actingAs($user)->get('/confirm-password');
9 |
10 | $response->assertStatus(200);
11 | });
12 |
13 | test('password can be confirmed', function () {
14 | $user = User::factory()->create();
15 |
16 | $response = $this->actingAs($user)->post('/confirm-password', [
17 | 'password' => 'password',
18 | ]);
19 |
20 | $response->assertRedirect();
21 | $response->assertSessionHasNoErrors();
22 | });
23 |
24 | test('password is not confirmed with invalid password', function () {
25 | $user = User::factory()->create();
26 |
27 | $response = $this->actingAs($user)->post('/confirm-password', [
28 | 'password' => 'wrong-password',
29 | ]);
30 |
31 | $response->assertSessionHasErrors();
32 | });
33 |
--------------------------------------------------------------------------------
/resources/js/Components/NavLink.vue:
--------------------------------------------------------------------------------
1 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/Http/Middleware/HandleInertiaRequests.php:
--------------------------------------------------------------------------------
1 |
29 | */
30 | public function share(Request $request): array
31 | {
32 | return [
33 | ...parent::share($request),
34 | 'auth' => [
35 | 'user' => $request->user(),
36 | ],
37 | ];
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | ## Exploring Laravel Reverb
11 |
12 | [Click here to watch the episode](https://laracasts.com/series/lukes-larabits/episodes/17)
13 |
14 |
--------------------------------------------------------------------------------
/database/migrations/2024_03_12_161736_create_podcasts_table.php:
--------------------------------------------------------------------------------
1 | id();
18 | $table->foreignIdFor(User::class)->constrained()->cascadeOnDelete();
19 | $table->string('name');
20 | $table->text('description');
21 | $table->tinyInteger('status');
22 | $table->dateTime('published_at')->nullable();
23 | $table->timestamps();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | */
30 | public function down(): void
31 | {
32 | Schema::dropIfExists('podcasts');
33 | }
34 | };
35 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/resources/js/Components/ResponsiveNavLink.vue:
--------------------------------------------------------------------------------
1 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/Events/PodcastPublished.php:
--------------------------------------------------------------------------------
1 |
30 | */
31 | public function broadcastOn(): array
32 | {
33 | return [
34 | new PrivateChannel("App.Models.User.{$this->podcast->user->id}"),
35 | ];
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/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 | 'slack' => [
28 | 'notifications' => [
29 | 'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
30 | 'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
31 | ],
32 | ],
33 |
34 | ];
35 |
--------------------------------------------------------------------------------
/tests/Feature/Auth/AuthenticationTest.php:
--------------------------------------------------------------------------------
1 | get('/login');
7 |
8 | $response->assertStatus(200);
9 | });
10 |
11 | test('users can authenticate using the login screen', function () {
12 | $user = User::factory()->create();
13 |
14 | $response = $this->post('/login', [
15 | 'email' => $user->email,
16 | 'password' => 'password',
17 | ]);
18 |
19 | $this->assertAuthenticated();
20 | $response->assertRedirect(route('dashboard', absolute: false));
21 | });
22 |
23 | test('users can not authenticate with invalid password', function () {
24 | $user = User::factory()->create();
25 |
26 | $this->post('/login', [
27 | 'email' => $user->email,
28 | 'password' => 'wrong-password',
29 | ]);
30 |
31 | $this->assertGuest();
32 | });
33 |
34 | test('users can logout', function () {
35 | $user = User::factory()->create();
36 |
37 | $response = $this->actingAs($user)->post('/logout');
38 |
39 | $this->assertGuest();
40 | $response->assertRedirect('/');
41 | });
42 |
--------------------------------------------------------------------------------
/app/Jobs/PublishPodcast.php:
--------------------------------------------------------------------------------
1 | podcast->update([
33 | 'status' => PodcastStatus::Published,
34 | 'published_at' => now(),
35 | ]);
36 |
37 | PodcastPublished::dispatch($this->podcast);
38 | $this->podcast->user->notify(new \App\Notifications\PodcastPublished($this->podcast));
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ConfirmablePasswordController.php:
--------------------------------------------------------------------------------
1 | validate([
29 | 'email' => $request->user()->email,
30 | 'password' => $request->password,
31 | ])) {
32 | throw ValidationException::withMessages([
33 | 'password' => __('auth.password'),
34 | ]);
35 | }
36 |
37 | $request->session()->put('auth.password_confirmed_at', time());
38 |
39 | return redirect()->intended(route('dashboard', absolute: false));
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/tests/Feature/Auth/PasswordUpdateTest.php:
--------------------------------------------------------------------------------
1 | create();
8 |
9 | $response = $this
10 | ->actingAs($user)
11 | ->from('/profile')
12 | ->put('/password', [
13 | 'current_password' => 'password',
14 | 'password' => 'new-password',
15 | 'password_confirmation' => 'new-password',
16 | ]);
17 |
18 | $response
19 | ->assertSessionHasNoErrors()
20 | ->assertRedirect('/profile');
21 |
22 | $this->assertTrue(Hash::check('new-password', $user->refresh()->password));
23 | });
24 |
25 | test('correct password must be provided to update password', function () {
26 | $user = User::factory()->create();
27 |
28 | $response = $this
29 | ->actingAs($user)
30 | ->from('/profile')
31 | ->put('/password', [
32 | 'current_password' => 'wrong-password',
33 | 'password' => 'new-password',
34 | 'password_confirmation' => 'new-password',
35 | ]);
36 |
37 | $response
38 | ->assertSessionHasErrors('current_password')
39 | ->assertRedirect('/profile');
40 | });
41 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/app/Models/User.php:
--------------------------------------------------------------------------------
1 |
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 | public function podcasts(): HasMany
50 | {
51 | return $this->hasMany(Podcast::class);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/.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 | REVERB_APP_ID=your-app-id
16 | REVERB_APP_KEY=your-app-key
17 | REVERB_APP_SECRET=your-app-secret
18 |
19 | BCRYPT_ROUNDS=12
20 |
21 | LOG_CHANNEL=stack
22 | LOG_STACK=single
23 | LOG_DEPRECATIONS_CHANNEL=null
24 | LOG_LEVEL=debug
25 |
26 | DB_CONNECTION=sqlite
27 | # DB_HOST=127.0.0.1
28 | # DB_PORT=3306
29 | # DB_DATABASE=laravel
30 | # DB_USERNAME=root
31 | # DB_PASSWORD=
32 |
33 | SESSION_DRIVER=database
34 | SESSION_LIFETIME=120
35 | SESSION_ENCRYPT=false
36 | SESSION_PATH=/
37 | SESSION_DOMAIN=null
38 |
39 | BROADCAST_CONNECTION=log
40 | FILESYSTEM_DISK=local
41 | QUEUE_CONNECTION=database
42 |
43 | CACHE_STORE=database
44 | CACHE_PREFIX=
45 |
46 | MEMCACHED_HOST=127.0.0.1
47 |
48 | REDIS_CLIENT=phpredis
49 | REDIS_HOST=127.0.0.1
50 | REDIS_PASSWORD=null
51 | REDIS_PORT=6379
52 |
53 | MAIL_MAILER=log
54 | MAIL_HOST=127.0.0.1
55 | MAIL_PORT=2525
56 | MAIL_USERNAME=null
57 | MAIL_PASSWORD=null
58 | MAIL_ENCRYPTION=null
59 | MAIL_FROM_ADDRESS="hello@example.com"
60 | MAIL_FROM_NAME="${APP_NAME}"
61 |
62 | AWS_ACCESS_KEY_ID=
63 | AWS_SECRET_ACCESS_KEY=
64 | AWS_DEFAULT_REGION=us-east-1
65 | AWS_BUCKET=
66 | AWS_USE_PATH_STYLE_ENDPOINT=false
67 |
68 | VITE_APP_NAME="${APP_NAME}"
69 |
--------------------------------------------------------------------------------
/resources/js/Components/SimplePagination.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Showing
6 | {{ ' ' }}
7 | {{ paginator.from }}
8 | {{ ' ' }}
9 | to
10 | {{ ' ' }}
11 | {{ paginator.to }}
12 |
13 |
14 |
15 | Previous
16 | Next
17 |
18 |
19 |
20 |
21 |
29 |
--------------------------------------------------------------------------------
/app/Notifications/PodcastPublished.php:
--------------------------------------------------------------------------------
1 |
28 | */
29 | public function via(object $notifiable): array
30 | {
31 | return ['broadcast'];
32 | }
33 |
34 | /**
35 | * Get the mail representation of the notification.
36 | */
37 | public function toBroadcast(object $notifiable): BroadcastMessage
38 | {
39 | return new BroadcastMessage([
40 | 'content' => "The podcast {$this->podcast->id} has been published."
41 | ]);
42 | }
43 |
44 | /**
45 | * Get the array representation of the notification.
46 | *
47 | * @return array
48 | */
49 | public function toArray(object $notifiable): array
50 | {
51 | return [
52 | //
53 | ];
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/AuthenticatedSessionController.php:
--------------------------------------------------------------------------------
1 | Route::has('password.request'),
23 | 'status' => session('status'),
24 | ]);
25 | }
26 |
27 | /**
28 | * Handle an incoming authentication request.
29 | */
30 | public function store(LoginRequest $request): RedirectResponse
31 | {
32 | $request->authenticate();
33 |
34 | $request->session()->regenerate();
35 |
36 | return redirect()->intended(route('dashboard', absolute: false));
37 | }
38 |
39 | /**
40 | * Destroy an authenticated session.
41 | */
42 | public function destroy(Request $request): RedirectResponse
43 | {
44 | Auth::guard('web')->logout();
45 |
46 | $request->session()->invalidate();
47 |
48 | $request->session()->regenerateToken();
49 |
50 | return redirect('/');
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/RegisteredUserController.php:
--------------------------------------------------------------------------------
1 | validate([
34 | 'name' => 'required|string|max:255',
35 | 'email' => 'required|string|lowercase|email|max:255|unique:'.User::class,
36 | 'password' => ['required', 'confirmed', Rules\Password::defaults()],
37 | ]);
38 |
39 | $user = User::create([
40 | 'name' => $request->name,
41 | 'email' => $request->email,
42 | 'password' => Hash::make($request->password),
43 | ]);
44 |
45 | event(new Registered($user));
46 |
47 | Auth::login($user);
48 |
49 | return redirect(route('dashboard', absolute: false));
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/resources/js/Pages/Profile/Edit.vue:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | Profile
24 |
25 |
26 |
27 |
28 |
29 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/tests/Feature/Auth/EmailVerificationTest.php:
--------------------------------------------------------------------------------
1 | create([
10 | 'email_verified_at' => null,
11 | ]);
12 |
13 | $response = $this->actingAs($user)->get('/verify-email');
14 |
15 | $response->assertStatus(200);
16 | });
17 |
18 | test('email can be verified', function () {
19 | $user = User::factory()->create([
20 | 'email_verified_at' => null,
21 | ]);
22 |
23 | Event::fake();
24 |
25 | $verificationUrl = URL::temporarySignedRoute(
26 | 'verification.verify',
27 | now()->addMinutes(60),
28 | ['id' => $user->id, 'hash' => sha1($user->email)]
29 | );
30 |
31 | $response = $this->actingAs($user)->get($verificationUrl);
32 |
33 | Event::assertDispatched(Verified::class);
34 | expect($user->fresh()->hasVerifiedEmail())->toBeTrue();
35 | $response->assertRedirect(route('dashboard', absolute: false).'?verified=1');
36 | });
37 |
38 | test('email is not verified with invalid hash', function () {
39 | $user = User::factory()->create([
40 | 'email_verified_at' => null,
41 | ]);
42 |
43 | $verificationUrl = URL::temporarySignedRoute(
44 | 'verification.verify',
45 | now()->addMinutes(60),
46 | ['id' => $user->id, 'hash' => sha1('wrong-email')]
47 | );
48 |
49 | $this->actingAs($user)->get($verificationUrl);
50 |
51 | expect($user->fresh()->hasVerifiedEmail())->toBeFalse();
52 | });
53 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/PasswordResetLinkController.php:
--------------------------------------------------------------------------------
1 | session('status'),
22 | ]);
23 | }
24 |
25 | /**
26 | * Handle an incoming password reset link request.
27 | *
28 | * @throws \Illuminate\Validation\ValidationException
29 | */
30 | public function store(Request $request): RedirectResponse
31 | {
32 | $request->validate([
33 | 'email' => 'required|email',
34 | ]);
35 |
36 | // We will send the password reset link to this user. Once we have attempted
37 | // to send the link, we will examine the response then see the message we
38 | // need to show to the user. Finally, we'll send out a proper response.
39 | $status = Password::sendResetLink(
40 | $request->only('email')
41 | );
42 |
43 | if ($status == Password::RESET_LINK_SENT) {
44 | return back()->with('status', __($status));
45 | }
46 |
47 | throw ValidationException::withMessages([
48 | 'email' => [trans($status)],
49 | ]);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/routes/web.php:
--------------------------------------------------------------------------------
1 | Route::has('login'),
15 | 'canRegister' => Route::has('register'),
16 | 'laravelVersion' => Application::VERSION,
17 | 'phpVersion' => PHP_VERSION,
18 | ]);
19 | });
20 |
21 | Route::get('/dashboard', function () {
22 | return Inertia::render('Dashboard');
23 | })->middleware(['auth', 'verified'])->name('dashboard');
24 |
25 | Route::get('/podcasts', function (Request $request) {
26 | return Inertia::render('Podcasts/Index', [
27 | 'podcasts' => $request->user()->podcasts()->latest()->simplePaginate(10),
28 | ]);
29 | })->middleware(['auth', 'verified'])->name('podcasts.index');
30 |
31 | Route::put('/podcasts/{podcast}/publish', function (Request $request, Podcast $podcast) {
32 | $podcast->update(['status' => PodcastStatus::Publishing]);
33 | PublishPodcast::dispatch($podcast);
34 |
35 | return back();
36 | })->middleware(['auth', 'verified'])->name('podcasts.publish');
37 |
38 | Route::middleware('auth')->group(function () {
39 | Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
40 | Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
41 | Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
42 | });
43 |
44 | require __DIR__.'/auth.php';
45 |
--------------------------------------------------------------------------------
/database/migrations/0001_01_01_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->string('name');
17 | $table->string('email')->unique();
18 | $table->timestamp('email_verified_at')->nullable();
19 | $table->string('password');
20 | $table->rememberToken();
21 | $table->timestamps();
22 | });
23 |
24 | Schema::create('password_reset_tokens', function (Blueprint $table) {
25 | $table->string('email')->primary();
26 | $table->string('token');
27 | $table->timestamp('created_at')->nullable();
28 | });
29 |
30 | Schema::create('sessions', function (Blueprint $table) {
31 | $table->string('id')->primary();
32 | $table->foreignId('user_id')->nullable()->index();
33 | $table->string('ip_address', 45)->nullable();
34 | $table->text('user_agent')->nullable();
35 | $table->longText('payload');
36 | $table->integer('last_activity')->index();
37 | });
38 | }
39 |
40 | /**
41 | * Reverse the migrations.
42 | */
43 | public function down(): void
44 | {
45 | Schema::dropIfExists('users');
46 | Schema::dropIfExists('password_reset_tokens');
47 | Schema::dropIfExists('sessions');
48 | }
49 | };
50 |
--------------------------------------------------------------------------------
/tests/Pest.php:
--------------------------------------------------------------------------------
1 | in('Feature');
18 |
19 | /*
20 | |--------------------------------------------------------------------------
21 | | Expectations
22 | |--------------------------------------------------------------------------
23 | |
24 | | When you're writing tests, you often need to check that values meet certain conditions. The
25 | | "expect()" function gives you access to a set of "expectations" methods that you can use
26 | | to assert different things. Of course, you may extend the Expectation API at any time.
27 | |
28 | */
29 |
30 | expect()->extend('toBeOne', function () {
31 | return $this->toBe(1);
32 | });
33 |
34 | /*
35 | |--------------------------------------------------------------------------
36 | | Functions
37 | |--------------------------------------------------------------------------
38 | |
39 | | While Pest is very powerful out-of-the-box, you may have some testing code specific to your
40 | | project that you don't want to repeat in every file. Here you can also expose helpers as
41 | | global functions to help you to reduce the number of lines of code in your test files.
42 | |
43 | */
44 |
45 | function something()
46 | {
47 | // ..
48 | }
49 |
--------------------------------------------------------------------------------
/resources/js/Pages/Auth/ConfirmPassword.vue:
--------------------------------------------------------------------------------
1 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | This is a secure area of the application. Please confirm your password before continuing.
26 |
27 |
28 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/Http/Controllers/ProfileController.php:
--------------------------------------------------------------------------------
1 | $request->user() instanceof MustVerifyEmail,
23 | 'status' => session('status'),
24 | ]);
25 | }
26 |
27 | /**
28 | * Update the user's profile information.
29 | */
30 | public function update(ProfileUpdateRequest $request): RedirectResponse
31 | {
32 | $request->user()->fill($request->validated());
33 |
34 | if ($request->user()->isDirty('email')) {
35 | $request->user()->email_verified_at = null;
36 | }
37 |
38 | $request->user()->save();
39 |
40 | return Redirect::route('profile.edit');
41 | }
42 |
43 | /**
44 | * Delete the user's account.
45 | */
46 | public function destroy(Request $request): RedirectResponse
47 | {
48 | $request->validate([
49 | 'password' => ['required', 'current_password'],
50 | ]);
51 |
52 | $user = $request->user();
53 |
54 | Auth::logout();
55 |
56 | $user->delete();
57 |
58 | $request->session()->invalidate();
59 | $request->session()->regenerateToken();
60 |
61 | return Redirect::to('/');
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/tests/Feature/Auth/PasswordResetTest.php:
--------------------------------------------------------------------------------
1 | get('/forgot-password');
9 |
10 | $response->assertStatus(200);
11 | });
12 |
13 | test('reset password link can be requested', function () {
14 | Notification::fake();
15 |
16 | $user = User::factory()->create();
17 |
18 | $this->post('/forgot-password', ['email' => $user->email]);
19 |
20 | Notification::assertSentTo($user, ResetPassword::class);
21 | });
22 |
23 | test('reset password screen can be rendered', function () {
24 | Notification::fake();
25 |
26 | $user = User::factory()->create();
27 |
28 | $this->post('/forgot-password', ['email' => $user->email]);
29 |
30 | Notification::assertSentTo($user, ResetPassword::class, function ($notification) {
31 | $response = $this->get('/reset-password/'.$notification->token);
32 |
33 | $response->assertStatus(200);
34 |
35 | return true;
36 | });
37 | });
38 |
39 | test('password can be reset with valid token', function () {
40 | Notification::fake();
41 |
42 | $user = User::factory()->create();
43 |
44 | $this->post('/forgot-password', ['email' => $user->email]);
45 |
46 | Notification::assertSentTo($user, ResetPassword::class, function ($notification) use ($user) {
47 | $response = $this->post('/reset-password', [
48 | 'token' => $notification->token,
49 | 'email' => $user->email,
50 | 'password' => 'password',
51 | 'password_confirmation' => 'password',
52 | ]);
53 |
54 | $response
55 | ->assertSessionHasNoErrors()
56 | ->assertRedirect(route('login'));
57 |
58 | return true;
59 | });
60 | });
61 |
--------------------------------------------------------------------------------
/resources/js/Pages/Auth/VerifyEmail.vue:
--------------------------------------------------------------------------------
1 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | Thanks for signing up! Before getting started, could you verify your email address by clicking on the link
28 | we just emailed to you? If you didn't receive the email, we will gladly send you another.
29 |
30 |
31 |
32 | A new verification link has been sent to the email address you provided during registration.
33 |
34 |
35 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/resources/js/Pages/Auth/ForgotPassword.vue:
--------------------------------------------------------------------------------
1 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | Forgot your password? No problem. Just let us know your email address and we will email you a password reset
30 | link that will allow you to choose a new one.
31 |
32 |
33 |
34 | {{ status }}
35 |
36 |
37 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/database/migrations/0001_01_01_000002_create_jobs_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->string('queue')->index();
17 | $table->longText('payload');
18 | $table->unsignedTinyInteger('attempts');
19 | $table->unsignedInteger('reserved_at')->nullable();
20 | $table->unsignedInteger('available_at');
21 | $table->unsignedInteger('created_at');
22 | });
23 |
24 | Schema::create('job_batches', function (Blueprint $table) {
25 | $table->string('id')->primary();
26 | $table->string('name');
27 | $table->integer('total_jobs');
28 | $table->integer('pending_jobs');
29 | $table->integer('failed_jobs');
30 | $table->longText('failed_job_ids');
31 | $table->mediumText('options')->nullable();
32 | $table->integer('cancelled_at')->nullable();
33 | $table->integer('created_at');
34 | $table->integer('finished_at')->nullable();
35 | });
36 |
37 | Schema::create('failed_jobs', function (Blueprint $table) {
38 | $table->id();
39 | $table->string('uuid')->unique();
40 | $table->text('connection');
41 | $table->text('queue');
42 | $table->longText('payload');
43 | $table->longText('exception');
44 | $table->timestamp('failed_at')->useCurrent();
45 | });
46 | }
47 |
48 | /**
49 | * Reverse the migrations.
50 | */
51 | public function down(): void
52 | {
53 | Schema::dropIfExists('jobs');
54 | Schema::dropIfExists('job_batches');
55 | Schema::dropIfExists('failed_jobs');
56 | }
57 | };
58 |
--------------------------------------------------------------------------------
/resources/js/Components/Notification.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
10 |
11 |
12 |
17 |
18 |
20 | Close
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
47 |
--------------------------------------------------------------------------------
/tests/Feature/ProfileTest.php:
--------------------------------------------------------------------------------
1 | create();
7 |
8 | $response = $this
9 | ->actingAs($user)
10 | ->get('/profile');
11 |
12 | $response->assertOk();
13 | });
14 |
15 | test('profile information can be updated', function () {
16 | $user = User::factory()->create();
17 |
18 | $response = $this
19 | ->actingAs($user)
20 | ->patch('/profile', [
21 | 'name' => 'Test User',
22 | 'email' => 'test@example.com',
23 | ]);
24 |
25 | $response
26 | ->assertSessionHasNoErrors()
27 | ->assertRedirect('/profile');
28 |
29 | $user->refresh();
30 |
31 | $this->assertSame('Test User', $user->name);
32 | $this->assertSame('test@example.com', $user->email);
33 | $this->assertNull($user->email_verified_at);
34 | });
35 |
36 | test('email verification status is unchanged when the email address is unchanged', function () {
37 | $user = User::factory()->create();
38 |
39 | $response = $this
40 | ->actingAs($user)
41 | ->patch('/profile', [
42 | 'name' => 'Test User',
43 | 'email' => $user->email,
44 | ]);
45 |
46 | $response
47 | ->assertSessionHasNoErrors()
48 | ->assertRedirect('/profile');
49 |
50 | $this->assertNotNull($user->refresh()->email_verified_at);
51 | });
52 |
53 | test('user can delete their account', function () {
54 | $user = User::factory()->create();
55 |
56 | $response = $this
57 | ->actingAs($user)
58 | ->delete('/profile', [
59 | 'password' => 'password',
60 | ]);
61 |
62 | $response
63 | ->assertSessionHasNoErrors()
64 | ->assertRedirect('/');
65 |
66 | $this->assertGuest();
67 | $this->assertNull($user->fresh());
68 | });
69 |
70 | test('correct password must be provided to delete account', function () {
71 | $user = User::factory()->create();
72 |
73 | $response = $this
74 | ->actingAs($user)
75 | ->from('/profile')
76 | ->delete('/profile', [
77 | 'password' => 'wrong-password',
78 | ]);
79 |
80 | $response
81 | ->assertSessionHasErrors('password')
82 | ->assertRedirect('/profile');
83 |
84 | $this->assertNotNull($user->fresh());
85 | });
86 |
--------------------------------------------------------------------------------
/resources/js/Components/Dropdown.vue:
--------------------------------------------------------------------------------
1 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
64 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "laravel/laravel",
3 | "type": "project",
4 | "description": "The skeleton application for the Laravel framework.",
5 | "keywords": ["laravel", "framework"],
6 | "license": "MIT",
7 | "require": {
8 | "php": "^8.2",
9 | "inertiajs/inertia-laravel": "^1.0",
10 | "laravel/breeze": "^2.0",
11 | "laravel/framework": "^11.0",
12 | "laravel/reverb": "@beta",
13 | "laravel/sanctum": "^4.0",
14 | "laravel/tinker": "^2.9",
15 | "tightenco/ziggy": "^2.0"
16 | },
17 | "require-dev": {
18 | "fakerphp/faker": "^1.23",
19 | "laravel/pint": "^1.13",
20 | "laravel/sail": "^1.26",
21 | "mockery/mockery": "^1.6",
22 | "nunomaduro/collision": "^8.0",
23 | "pestphp/pest": "^2.0",
24 | "pestphp/pest-plugin-laravel": "^2.0",
25 | "spatie/laravel-ignition": "^2.4"
26 | },
27 | "autoload": {
28 | "psr-4": {
29 | "App\\": "app/",
30 | "Database\\Factories\\": "database/factories/",
31 | "Database\\Seeders\\": "database/seeders/"
32 | }
33 | },
34 | "autoload-dev": {
35 | "psr-4": {
36 | "Tests\\": "tests/"
37 | }
38 | },
39 | "scripts": {
40 | "post-autoload-dump": [
41 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
42 | "@php artisan package:discover --ansi"
43 | ],
44 | "post-update-cmd": [
45 | "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
46 | ],
47 | "post-root-package-install": [
48 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
49 | ],
50 | "post-create-project-cmd": [
51 | "@php artisan key:generate --ansi",
52 | "@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
53 | "@php artisan migrate --graceful --ansi"
54 | ]
55 | },
56 | "extra": {
57 | "branch-alias": {
58 | "dev-master": "11.x-dev"
59 | },
60 | "laravel": {
61 | "dont-discover": []
62 | }
63 | },
64 | "config": {
65 | "optimize-autoloader": true,
66 | "preferred-install": "dist",
67 | "sort-packages": true,
68 | "allow-plugins": {
69 | "pestphp/pest-plugin": true,
70 | "php-http/discovery": true
71 | }
72 | },
73 | "minimum-stability": "stable",
74 | "prefer-stable": true
75 | }
76 |
--------------------------------------------------------------------------------
/app/Http/Requests/Auth/LoginRequest.php:
--------------------------------------------------------------------------------
1 |
26 | */
27 | public function rules(): array
28 | {
29 | return [
30 | 'email' => ['required', 'string', 'email'],
31 | 'password' => ['required', 'string'],
32 | ];
33 | }
34 |
35 | /**
36 | * Attempt to authenticate the request's credentials.
37 | *
38 | * @throws \Illuminate\Validation\ValidationException
39 | */
40 | public function authenticate(): void
41 | {
42 | $this->ensureIsNotRateLimited();
43 |
44 | if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) {
45 | RateLimiter::hit($this->throttleKey());
46 |
47 | throw ValidationException::withMessages([
48 | 'email' => trans('auth.failed'),
49 | ]);
50 | }
51 |
52 | RateLimiter::clear($this->throttleKey());
53 | }
54 |
55 | /**
56 | * Ensure the login request is not rate limited.
57 | *
58 | * @throws \Illuminate\Validation\ValidationException
59 | */
60 | public function ensureIsNotRateLimited(): void
61 | {
62 | if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {
63 | return;
64 | }
65 |
66 | event(new Lockout($this));
67 |
68 | $seconds = RateLimiter::availableIn($this->throttleKey());
69 |
70 | throw ValidationException::withMessages([
71 | 'email' => trans('auth.throttle', [
72 | 'seconds' => $seconds,
73 | 'minutes' => ceil($seconds / 60),
74 | ]),
75 | ]);
76 | }
77 |
78 | /**
79 | * Get the rate limiting throttle key for the request.
80 | */
81 | public function throttleKey(): string
82 | {
83 | return Str::transliterate(Str::lower($this->string('email')).'|'.$this->ip());
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/NewPasswordController.php:
--------------------------------------------------------------------------------
1 | $request->email,
26 | 'token' => $request->route('token'),
27 | ]);
28 | }
29 |
30 | /**
31 | * Handle an incoming new password request.
32 | *
33 | * @throws \Illuminate\Validation\ValidationException
34 | */
35 | public function store(Request $request): RedirectResponse
36 | {
37 | $request->validate([
38 | 'token' => 'required',
39 | 'email' => 'required|email',
40 | 'password' => ['required', 'confirmed', Rules\Password::defaults()],
41 | ]);
42 |
43 | // Here we will attempt to reset the user's password. If it is successful we
44 | // will update the password on an actual user model and persist it to the
45 | // database. Otherwise we will parse the error and return the response.
46 | $status = Password::reset(
47 | $request->only('email', 'password', 'password_confirmation', 'token'),
48 | function ($user) use ($request) {
49 | $user->forceFill([
50 | 'password' => Hash::make($request->password),
51 | 'remember_token' => Str::random(60),
52 | ])->save();
53 |
54 | event(new PasswordReset($user));
55 | }
56 | );
57 |
58 | // If the password was successfully reset, we will redirect the user back to
59 | // the application's home authenticated view. If there is an error we can
60 | // redirect them back to where they came from with their error message.
61 | if ($status == Password::PASSWORD_RESET) {
62 | return redirect()->route('login')->with('status', __($status));
63 | }
64 |
65 | throw ValidationException::withMessages([
66 | 'email' => [trans($status)],
67 | ]);
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/config/filesystems.php:
--------------------------------------------------------------------------------
1 | env('FILESYSTEM_DISK', 'local'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Filesystem Disks
21 | |--------------------------------------------------------------------------
22 | |
23 | | Below you may configure as many filesystem disks as necessary, and you
24 | | may even configure multiple disks for the same driver. Examples for
25 | | most supported storage drivers are configured here for reference.
26 | |
27 | | Supported Drivers: "local", "ftp", "sftp", "s3"
28 | |
29 | */
30 |
31 | 'disks' => [
32 |
33 | 'local' => [
34 | 'driver' => 'local',
35 | 'root' => storage_path('app'),
36 | 'throw' => false,
37 | ],
38 |
39 | 'public' => [
40 | 'driver' => 'local',
41 | 'root' => storage_path('app/public'),
42 | 'url' => env('APP_URL').'/storage',
43 | 'visibility' => 'public',
44 | 'throw' => false,
45 | ],
46 |
47 | 's3' => [
48 | 'driver' => 's3',
49 | 'key' => env('AWS_ACCESS_KEY_ID'),
50 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
51 | 'region' => env('AWS_DEFAULT_REGION'),
52 | 'bucket' => env('AWS_BUCKET'),
53 | 'url' => env('AWS_URL'),
54 | 'endpoint' => env('AWS_ENDPOINT'),
55 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
56 | 'throw' => false,
57 | ],
58 |
59 | ],
60 |
61 | /*
62 | |--------------------------------------------------------------------------
63 | | Symbolic Links
64 | |--------------------------------------------------------------------------
65 | |
66 | | Here you may configure the symbolic links that will be created when the
67 | | `storage:link` Artisan command is executed. The array keys should be
68 | | the locations of the links and the values should be their targets.
69 | |
70 | */
71 |
72 | 'links' => [
73 | public_path('storage') => storage_path('app/public'),
74 | ],
75 |
76 | ];
77 |
--------------------------------------------------------------------------------
/routes/auth.php:
--------------------------------------------------------------------------------
1 | group(function () {
15 | Route::get('register', [RegisteredUserController::class, 'create'])
16 | ->name('register');
17 |
18 | Route::post('register', [RegisteredUserController::class, 'store']);
19 |
20 | Route::get('login', [AuthenticatedSessionController::class, 'create'])
21 | ->name('login');
22 |
23 | Route::post('login', [AuthenticatedSessionController::class, 'store']);
24 |
25 | Route::get('forgot-password', [PasswordResetLinkController::class, 'create'])
26 | ->name('password.request');
27 |
28 | Route::post('forgot-password', [PasswordResetLinkController::class, 'store'])
29 | ->name('password.email');
30 |
31 | Route::get('reset-password/{token}', [NewPasswordController::class, 'create'])
32 | ->name('password.reset');
33 |
34 | Route::post('reset-password', [NewPasswordController::class, 'store'])
35 | ->name('password.store');
36 | });
37 |
38 | Route::middleware('auth')->group(function () {
39 | Route::get('verify-email', EmailVerificationPromptController::class)
40 | ->name('verification.notice');
41 |
42 | Route::get('verify-email/{id}/{hash}', VerifyEmailController::class)
43 | ->middleware(['signed', 'throttle:6,1'])
44 | ->name('verification.verify');
45 |
46 | Route::post('email/verification-notification', [EmailVerificationNotificationController::class, 'store'])
47 | ->middleware('throttle:6,1')
48 | ->name('verification.send');
49 |
50 | Route::get('confirm-password', [ConfirmablePasswordController::class, 'show'])
51 | ->name('password.confirm');
52 |
53 | Route::post('confirm-password', [ConfirmablePasswordController::class, 'store']);
54 |
55 | Route::put('password', [PasswordController::class, 'update'])->name('password.update');
56 |
57 | Route::post('logout', [AuthenticatedSessionController::class, 'destroy'])
58 | ->name('logout');
59 | });
60 |
--------------------------------------------------------------------------------
/config/reverb.php:
--------------------------------------------------------------------------------
1 | env('REVERB_SERVER', 'reverb'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Reverb Servers
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may define details for each of the supported Reverb servers.
24 | | Each server has its own configuration options that are defined in
25 | | the array below. You should ensure all the options are present.
26 | |
27 | */
28 |
29 | 'servers' => [
30 |
31 | 'reverb' => [
32 | 'host' => env('REVERB_SERVER_HOST', '0.0.0.0'),
33 | 'port' => env('REVERB_SERVER_PORT', 8080),
34 | 'hostname' => env('REVERB_HOST'),
35 | 'options' => [
36 | 'tls' => [],
37 | ],
38 | 'scaling' => [
39 | 'enabled' => env('REVERB_SCALING_ENABLED', false),
40 | 'channel' => env('REVERB_SCALING_CHANNEL', 'reverb'),
41 | ],
42 | 'pulse_ingest_interval' => env('REVERB_PULSE_INGEST_INTERVAL', 15),
43 | ],
44 |
45 | ],
46 |
47 | /*
48 | |--------------------------------------------------------------------------
49 | | Reverb Applications
50 | |--------------------------------------------------------------------------
51 | |
52 | | Here you may define how Reverb applications are managed. If you choose
53 | | to use the "config" provider, you may define an array of apps which
54 | | your server will support, including their connection credentials.
55 | |
56 | */
57 |
58 | 'apps' => [
59 |
60 | 'provider' => 'config',
61 |
62 | 'apps' => [
63 | [
64 | 'key' => env('REVERB_APP_KEY'),
65 | 'secret' => env('REVERB_APP_SECRET'),
66 | 'app_id' => env('REVERB_APP_ID'),
67 | 'options' => [
68 | 'host' => env('REVERB_HOST'),
69 | 'port' => env('REVERB_PORT', 443),
70 | 'scheme' => env('REVERB_SCHEME', 'https'),
71 | 'useTLS' => env('REVERB_SCHEME', 'https') === 'https',
72 | ],
73 | 'allowed_origins' => ['*'],
74 | 'ping_interval' => env('REVERB_APP_PING_INTERVAL', 60),
75 | 'max_message_size' => env('REVERB_APP_MAX_MESSAGE_SIZE', 10000),
76 | ],
77 | ],
78 |
79 | ],
80 |
81 | ];
82 |
--------------------------------------------------------------------------------
/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_CONNECTION', 'null'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over WebSockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'reverb' => [
34 | 'driver' => 'reverb',
35 | 'key' => env('REVERB_APP_KEY'),
36 | 'secret' => env('REVERB_APP_SECRET'),
37 | 'app_id' => env('REVERB_APP_ID'),
38 | 'options' => [
39 | 'host' => env('REVERB_HOST'),
40 | 'port' => env('REVERB_PORT', 443),
41 | 'scheme' => env('REVERB_SCHEME', 'https'),
42 | 'useTLS' => env('REVERB_SCHEME', 'https') === 'https',
43 | ],
44 | 'client_options' => [
45 | // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
46 | ],
47 | ],
48 |
49 | 'pusher' => [
50 | 'driver' => 'pusher',
51 | 'key' => env('PUSHER_APP_KEY'),
52 | 'secret' => env('PUSHER_APP_SECRET'),
53 | 'app_id' => env('PUSHER_APP_ID'),
54 | 'options' => [
55 | 'cluster' => env('PUSHER_APP_CLUSTER'),
56 | 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
57 | 'port' => env('PUSHER_PORT', 443),
58 | 'scheme' => env('PUSHER_SCHEME', 'https'),
59 | 'encrypted' => true,
60 | 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
61 | ],
62 | 'client_options' => [
63 | // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
64 | ],
65 | ],
66 |
67 | 'ably' => [
68 | 'driver' => 'ably',
69 | 'key' => env('ABLY_KEY'),
70 | ],
71 |
72 | 'log' => [
73 | 'driver' => 'log',
74 | ],
75 |
76 | 'null' => [
77 | 'driver' => 'null',
78 | ],
79 |
80 | ],
81 |
82 | ];
83 |
--------------------------------------------------------------------------------
/resources/js/Components/ApplicationLogo.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/resources/js/Pages/Auth/ResetPassword.vue:
--------------------------------------------------------------------------------
1 |
33 |
34 |
35 |
36 |
37 |
38 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/resources/js/Pages/Podcasts/Index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Your Podcasts
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
{{ podcast.name }}
16 |
{{ podcast.description }}
17 |
20 |
21 |
22 |
23 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
74 |
--------------------------------------------------------------------------------
/resources/js/Pages/Auth/Login.vue:
--------------------------------------------------------------------------------
1 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | {{ status }}
38 |
39 |
40 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/resources/js/Components/Modal.vue:
--------------------------------------------------------------------------------
1 |
61 |
62 |
63 |
64 |
65 |
66 |
74 |
77 |
78 |
79 |
87 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/resources/js/Pages/Profile/Partials/DeleteUserForm.vue:
--------------------------------------------------------------------------------
1 |
39 |
40 |
41 |
42 |
43 | Delete Account
44 |
45 |
46 | Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting
47 | your account, please download any data or information that you wish to retain.
48 |
49 |
50 |
51 | Delete Account
52 |
53 |
54 |
55 |
56 | Are you sure you want to delete your account?
57 |
58 |
59 |
60 | Once your account is deleted, all of its resources and data will be permanently deleted. Please
61 | enter your password to confirm you would like to permanently delete your account.
62 |
63 |
64 |
65 |
66 |
67 |
76 |
77 |
78 |
79 |
80 |
81 | Cancel
82 |
83 |
89 | Delete Account
90 |
91 |
92 |
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/config/mail.php:
--------------------------------------------------------------------------------
1 | env('MAIL_MAILER', 'log'),
18 |
19 | /*
20 | |--------------------------------------------------------------------------
21 | | Mailer Configurations
22 | |--------------------------------------------------------------------------
23 | |
24 | | Here you may configure all of the mailers used by your application plus
25 | | their respective settings. Several examples have been configured for
26 | | you and you are free to add your own as your application requires.
27 | |
28 | | Laravel supports a variety of mail "transport" drivers that can be used
29 | | when delivering an email. You may specify which one you're using for
30 | | your mailers below. You may also add additional mailers if needed.
31 | |
32 | | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
33 | | "postmark", "log", "array", "failover", "roundrobin"
34 | |
35 | */
36 |
37 | 'mailers' => [
38 |
39 | 'smtp' => [
40 | 'transport' => 'smtp',
41 | 'url' => env('MAIL_URL'),
42 | 'host' => env('MAIL_HOST', '127.0.0.1'),
43 | 'port' => env('MAIL_PORT', 2525),
44 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
45 | 'username' => env('MAIL_USERNAME'),
46 | 'password' => env('MAIL_PASSWORD'),
47 | 'timeout' => null,
48 | 'local_domain' => env('MAIL_EHLO_DOMAIN'),
49 | ],
50 |
51 | 'ses' => [
52 | 'transport' => 'ses',
53 | ],
54 |
55 | 'postmark' => [
56 | 'transport' => 'postmark',
57 | // 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'),
58 | // 'client' => [
59 | // 'timeout' => 5,
60 | // ],
61 | ],
62 |
63 | 'sendmail' => [
64 | 'transport' => 'sendmail',
65 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
66 | ],
67 |
68 | 'log' => [
69 | 'transport' => 'log',
70 | 'channel' => env('MAIL_LOG_CHANNEL'),
71 | ],
72 |
73 | 'array' => [
74 | 'transport' => 'array',
75 | ],
76 |
77 | 'failover' => [
78 | 'transport' => 'failover',
79 | 'mailers' => [
80 | 'smtp',
81 | 'log',
82 | ],
83 | ],
84 |
85 | ],
86 |
87 | /*
88 | |--------------------------------------------------------------------------
89 | | Global "From" Address
90 | |--------------------------------------------------------------------------
91 | |
92 | | You may wish for all emails sent by your application to be sent from
93 | | the same address. Here you may specify a name and address that is
94 | | used globally for all emails that are sent by your application.
95 | |
96 | */
97 |
98 | 'from' => [
99 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
100 | 'name' => env('MAIL_FROM_NAME', 'Example'),
101 | ],
102 |
103 | ];
104 |
--------------------------------------------------------------------------------
/resources/js/Pages/Auth/Register.vue:
--------------------------------------------------------------------------------
1 |
22 |
23 |
24 |
25 |
26 |
27 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/resources/js/Pages/Profile/Partials/UpdateProfileInformationForm.vue:
--------------------------------------------------------------------------------
1 |
24 |
25 |
26 |
102 |
103 |
--------------------------------------------------------------------------------
/config/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_STORE', 'database'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Cache Stores
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the cache "stores" for your application as
26 | | well as their drivers. You may even define multiple stores for the
27 | | same cache driver to group types of items stored in your caches.
28 | |
29 | | Supported drivers: "apc", "array", "database", "file", "memcached",
30 | | "redis", "dynamodb", "octane", "null"
31 | |
32 | */
33 |
34 | 'stores' => [
35 |
36 | 'array' => [
37 | 'driver' => 'array',
38 | 'serialize' => false,
39 | ],
40 |
41 | 'database' => [
42 | 'driver' => 'database',
43 | 'table' => env('DB_CACHE_TABLE', 'cache'),
44 | 'connection' => env('DB_CACHE_CONNECTION', null),
45 | 'lock_connection' => env('DB_CACHE_LOCK_CONNECTION', null),
46 | ],
47 |
48 | 'file' => [
49 | 'driver' => 'file',
50 | 'path' => storage_path('framework/cache/data'),
51 | 'lock_path' => storage_path('framework/cache/data'),
52 | ],
53 |
54 | 'memcached' => [
55 | 'driver' => 'memcached',
56 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
57 | 'sasl' => [
58 | env('MEMCACHED_USERNAME'),
59 | env('MEMCACHED_PASSWORD'),
60 | ],
61 | 'options' => [
62 | // Memcached::OPT_CONNECT_TIMEOUT => 2000,
63 | ],
64 | 'servers' => [
65 | [
66 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
67 | 'port' => env('MEMCACHED_PORT', 11211),
68 | 'weight' => 100,
69 | ],
70 | ],
71 | ],
72 |
73 | 'redis' => [
74 | 'driver' => 'redis',
75 | 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
76 | 'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
77 | ],
78 |
79 | 'dynamodb' => [
80 | 'driver' => 'dynamodb',
81 | 'key' => env('AWS_ACCESS_KEY_ID'),
82 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
83 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
84 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
85 | 'endpoint' => env('DYNAMODB_ENDPOINT'),
86 | ],
87 |
88 | 'octane' => [
89 | 'driver' => 'octane',
90 | ],
91 |
92 | ],
93 |
94 | /*
95 | |--------------------------------------------------------------------------
96 | | Cache Key Prefix
97 | |--------------------------------------------------------------------------
98 | |
99 | | When utilizing the APC, database, memcached, Redis, and DynamoDB cache
100 | | stores, there might be other applications using the same cache. For
101 | | that reason, you may prefix every cache key to avoid collisions.
102 | |
103 | */
104 |
105 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
106 |
107 | ];
108 |
--------------------------------------------------------------------------------
/resources/js/Pages/Profile/Partials/UpdatePasswordForm.vue:
--------------------------------------------------------------------------------
1 |
35 |
36 |
37 |
105 |
106 |
--------------------------------------------------------------------------------
/config/queue.php:
--------------------------------------------------------------------------------
1 | env('QUEUE_CONNECTION', 'database'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Queue Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure the connection options for every queue backend
24 | | used by your application. An example configuration is provided for
25 | | each backend supported by Laravel. You're also free to add more.
26 | |
27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'sync' => [
34 | 'driver' => 'sync',
35 | ],
36 |
37 | 'database' => [
38 | 'driver' => 'database',
39 | 'connection' => env('DB_QUEUE_CONNECTION', null),
40 | 'table' => env('DB_QUEUE_TABLE', 'jobs'),
41 | 'queue' => env('DB_QUEUE', 'default'),
42 | 'retry_after' => env('DB_QUEUE_RETRY_AFTER', 90),
43 | 'after_commit' => false,
44 | ],
45 |
46 | 'beanstalkd' => [
47 | 'driver' => 'beanstalkd',
48 | 'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
49 | 'queue' => env('BEANSTALKD_QUEUE', 'default'),
50 | 'retry_after' => env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
51 | 'block_for' => 0,
52 | 'after_commit' => false,
53 | ],
54 |
55 | 'sqs' => [
56 | 'driver' => 'sqs',
57 | 'key' => env('AWS_ACCESS_KEY_ID'),
58 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
59 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
60 | 'queue' => env('SQS_QUEUE', 'default'),
61 | 'suffix' => env('SQS_SUFFIX'),
62 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
63 | 'after_commit' => false,
64 | ],
65 |
66 | 'redis' => [
67 | 'driver' => 'redis',
68 | 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
69 | 'queue' => env('REDIS_QUEUE', 'default'),
70 | 'retry_after' => env('REDIS_QUEUE_RETRY_AFTER', 90),
71 | 'block_for' => null,
72 | 'after_commit' => false,
73 | ],
74 |
75 | ],
76 |
77 | /*
78 | |--------------------------------------------------------------------------
79 | | Job Batching
80 | |--------------------------------------------------------------------------
81 | |
82 | | The following options configure the database and table that store job
83 | | batching information. These options can be updated to any database
84 | | connection and table which has been defined by your application.
85 | |
86 | */
87 |
88 | 'batching' => [
89 | 'database' => env('DB_CONNECTION', 'sqlite'),
90 | 'table' => 'job_batches',
91 | ],
92 |
93 | /*
94 | |--------------------------------------------------------------------------
95 | | Failed Queue Jobs
96 | |--------------------------------------------------------------------------
97 | |
98 | | These options configure the behavior of failed queue job logging so you
99 | | can control how and where failed jobs are stored. Laravel ships with
100 | | support for storing failed jobs in a simple file or in a database.
101 | |
102 | | Supported drivers: "database-uuids", "dynamodb", "file", "null"
103 | |
104 | */
105 |
106 | 'failed' => [
107 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
108 | 'database' => env('DB_CONNECTION', 'sqlite'),
109 | 'table' => 'failed_jobs',
110 | ],
111 |
112 | ];
113 |
--------------------------------------------------------------------------------
/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => env('AUTH_GUARD', 'web'),
18 | 'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
19 | ],
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Authentication Guards
24 | |--------------------------------------------------------------------------
25 | |
26 | | Next, you may define every authentication guard for your application.
27 | | Of course, a great default configuration has been defined for you
28 | | which utilizes session storage plus the Eloquent user provider.
29 | |
30 | | All authentication guards have a user provider, which defines how the
31 | | users are actually retrieved out of your database or other storage
32 | | system used by the application. Typically, Eloquent is utilized.
33 | |
34 | | Supported: "session"
35 | |
36 | */
37 |
38 | 'guards' => [
39 | 'web' => [
40 | 'driver' => 'session',
41 | 'provider' => 'users',
42 | ],
43 | ],
44 |
45 | /*
46 | |--------------------------------------------------------------------------
47 | | User Providers
48 | |--------------------------------------------------------------------------
49 | |
50 | | All authentication guards have a user provider, which defines how the
51 | | users are actually retrieved out of your database or other storage
52 | | system used by the application. Typically, Eloquent is utilized.
53 | |
54 | | If you have multiple user tables or models you may configure multiple
55 | | providers to represent the model / table. These providers may then
56 | | be assigned to any extra authentication guards you have defined.
57 | |
58 | | Supported: "database", "eloquent"
59 | |
60 | */
61 |
62 | 'providers' => [
63 | 'users' => [
64 | 'driver' => 'eloquent',
65 | 'model' => env('AUTH_MODEL', App\Models\User::class),
66 | ],
67 |
68 | // 'users' => [
69 | // 'driver' => 'database',
70 | // 'table' => 'users',
71 | // ],
72 | ],
73 |
74 | /*
75 | |--------------------------------------------------------------------------
76 | | Resetting Passwords
77 | |--------------------------------------------------------------------------
78 | |
79 | | These configuration options specify the behavior of Laravel's password
80 | | reset functionality, including the table utilized for token storage
81 | | and the user provider that is invoked to actually retrieve users.
82 | |
83 | | The expiry time is the number of minutes that each reset token will be
84 | | considered valid. This security feature keeps tokens short-lived so
85 | | they have less time to be guessed. You may change this as needed.
86 | |
87 | | The throttle setting is the number of seconds a user must wait before
88 | | generating more password reset tokens. This prevents the user from
89 | | quickly generating a very large amount of password reset tokens.
90 | |
91 | */
92 |
93 | 'passwords' => [
94 | 'users' => [
95 | 'provider' => 'users',
96 | 'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
97 | 'expire' => 60,
98 | 'throttle' => 60,
99 | ],
100 | ],
101 |
102 | /*
103 | |--------------------------------------------------------------------------
104 | | Password Confirmation Timeout
105 | |--------------------------------------------------------------------------
106 | |
107 | | Here you may define the amount of seconds before a password confirmation
108 | | window expires and users are asked to re-enter their password via the
109 | | confirmation screen. By default, the timeout lasts for three hours.
110 | |
111 | */
112 |
113 | 'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800),
114 |
115 | ];
116 |
--------------------------------------------------------------------------------
/config/app.php:
--------------------------------------------------------------------------------
1 | env('APP_NAME', 'Laravel'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Application Environment
21 | |--------------------------------------------------------------------------
22 | |
23 | | This value determines the "environment" your application is currently
24 | | running in. This may determine how you prefer to configure various
25 | | services the application utilizes. Set this in your ".env" file.
26 | |
27 | */
28 |
29 | 'env' => env('APP_ENV', 'production'),
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Application Debug Mode
34 | |--------------------------------------------------------------------------
35 | |
36 | | When your application is in debug mode, detailed error messages with
37 | | stack traces will be shown on every error that occurs within your
38 | | application. If disabled, a simple generic error page is shown.
39 | |
40 | */
41 |
42 | 'debug' => (bool) env('APP_DEBUG', false),
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Application URL
47 | |--------------------------------------------------------------------------
48 | |
49 | | This URL is used by the console to properly generate URLs when using
50 | | the Artisan command line tool. You should set this to the root of
51 | | the application so that it's available within Artisan commands.
52 | |
53 | */
54 |
55 | 'url' => env('APP_URL', 'http://localhost'),
56 |
57 | /*
58 | |--------------------------------------------------------------------------
59 | | Application Timezone
60 | |--------------------------------------------------------------------------
61 | |
62 | | Here you may specify the default timezone for your application, which
63 | | will be used by the PHP date and date-time functions. The timezone
64 | | is set to "UTC" by default as it is suitable for most use cases.
65 | |
66 | */
67 |
68 | 'timezone' => env('APP_TIMEZONE', 'UTC'),
69 |
70 | /*
71 | |--------------------------------------------------------------------------
72 | | Application Locale Configuration
73 | |--------------------------------------------------------------------------
74 | |
75 | | The application locale determines the default locale that will be used
76 | | by Laravel's translation / localization methods. This option can be
77 | | set to any locale for which you plan to have translation strings.
78 | |
79 | */
80 |
81 | 'locale' => env('APP_LOCALE', 'en'),
82 |
83 | 'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
84 |
85 | 'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
86 |
87 | /*
88 | |--------------------------------------------------------------------------
89 | | Encryption Key
90 | |--------------------------------------------------------------------------
91 | |
92 | | This key is utilized by Laravel's encryption services and should be set
93 | | to a random, 32 character string to ensure that all encrypted values
94 | | are secure. You should do this prior to deploying the application.
95 | |
96 | */
97 |
98 | 'cipher' => 'AES-256-CBC',
99 |
100 | 'key' => env('APP_KEY'),
101 |
102 | 'previous_keys' => [
103 | ...array_filter(
104 | explode(',', env('APP_PREVIOUS_KEYS', ''))
105 | ),
106 | ],
107 |
108 | /*
109 | |--------------------------------------------------------------------------
110 | | Maintenance Mode Driver
111 | |--------------------------------------------------------------------------
112 | |
113 | | These configuration options determine the driver used to determine and
114 | | manage Laravel's "maintenance mode" status. The "cache" driver will
115 | | allow maintenance mode to be controlled across multiple machines.
116 | |
117 | | Supported drivers: "file", "cache"
118 | |
119 | */
120 |
121 | 'maintenance' => [
122 | 'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
123 | 'store' => env('APP_MAINTENANCE_STORE', 'database'),
124 | ],
125 |
126 | ];
127 |
--------------------------------------------------------------------------------
/config/logging.php:
--------------------------------------------------------------------------------
1 | env('LOG_CHANNEL', 'stack'),
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | Deprecations Log Channel
26 | |--------------------------------------------------------------------------
27 | |
28 | | This option controls the log channel that should be used to log warnings
29 | | regarding deprecated PHP and library features. This allows you to get
30 | | your application ready for upcoming major versions of dependencies.
31 | |
32 | */
33 |
34 | 'deprecations' => [
35 | 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
36 | 'trace' => env('LOG_DEPRECATIONS_TRACE', false),
37 | ],
38 |
39 | /*
40 | |--------------------------------------------------------------------------
41 | | Log Channels
42 | |--------------------------------------------------------------------------
43 | |
44 | | Here you may configure the log channels for your application. Laravel
45 | | utilizes the Monolog PHP logging library, which includes a variety
46 | | of powerful log handlers and formatters that you're free to use.
47 | |
48 | | Available Drivers: "single", "daily", "slack", "syslog",
49 | | "errorlog", "monolog", "custom", "stack"
50 | |
51 | */
52 |
53 | 'channels' => [
54 |
55 | 'stack' => [
56 | 'driver' => 'stack',
57 | 'channels' => explode(',', env('LOG_STACK', 'single')),
58 | 'ignore_exceptions' => false,
59 | ],
60 |
61 | 'single' => [
62 | 'driver' => 'single',
63 | 'path' => storage_path('logs/laravel.log'),
64 | 'level' => env('LOG_LEVEL', 'debug'),
65 | 'replace_placeholders' => true,
66 | ],
67 |
68 | 'daily' => [
69 | 'driver' => 'daily',
70 | 'path' => storage_path('logs/laravel.log'),
71 | 'level' => env('LOG_LEVEL', 'debug'),
72 | 'days' => env('LOG_DAILY_DAYS', 14),
73 | 'replace_placeholders' => true,
74 | ],
75 |
76 | 'slack' => [
77 | 'driver' => 'slack',
78 | 'url' => env('LOG_SLACK_WEBHOOK_URL'),
79 | 'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
80 | 'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
81 | 'level' => env('LOG_LEVEL', 'critical'),
82 | 'replace_placeholders' => true,
83 | ],
84 |
85 | 'papertrail' => [
86 | 'driver' => 'monolog',
87 | 'level' => env('LOG_LEVEL', 'debug'),
88 | 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
89 | 'handler_with' => [
90 | 'host' => env('PAPERTRAIL_URL'),
91 | 'port' => env('PAPERTRAIL_PORT'),
92 | 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
93 | ],
94 | 'processors' => [PsrLogMessageProcessor::class],
95 | ],
96 |
97 | 'stderr' => [
98 | 'driver' => 'monolog',
99 | 'level' => env('LOG_LEVEL', 'debug'),
100 | 'handler' => StreamHandler::class,
101 | 'formatter' => env('LOG_STDERR_FORMATTER'),
102 | 'with' => [
103 | 'stream' => 'php://stderr',
104 | ],
105 | 'processors' => [PsrLogMessageProcessor::class],
106 | ],
107 |
108 | 'syslog' => [
109 | 'driver' => 'syslog',
110 | 'level' => env('LOG_LEVEL', 'debug'),
111 | 'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER),
112 | 'replace_placeholders' => true,
113 | ],
114 |
115 | 'errorlog' => [
116 | 'driver' => 'errorlog',
117 | 'level' => env('LOG_LEVEL', 'debug'),
118 | 'replace_placeholders' => true,
119 | ],
120 |
121 | 'null' => [
122 | 'driver' => 'monolog',
123 | 'handler' => NullHandler::class,
124 | ],
125 |
126 | 'emergency' => [
127 | 'path' => storage_path('logs/laravel.log'),
128 | ],
129 |
130 | ],
131 |
132 | ];
133 |
--------------------------------------------------------------------------------
/config/database.php:
--------------------------------------------------------------------------------
1 | env('DB_CONNECTION', 'sqlite'),
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Database Connections
24 | |--------------------------------------------------------------------------
25 | |
26 | | Below are all of the database connections defined for your application.
27 | | An example configuration is provided for each database system which
28 | | is supported by Laravel. You're free to add / remove connections.
29 | |
30 | */
31 |
32 | 'connections' => [
33 |
34 | 'sqlite' => [
35 | 'driver' => 'sqlite',
36 | 'url' => env('DB_URL'),
37 | 'database' => env('DB_DATABASE', database_path('database.sqlite')),
38 | 'prefix' => '',
39 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
40 | ],
41 |
42 | 'mysql' => [
43 | 'driver' => 'mysql',
44 | 'url' => env('DB_URL'),
45 | 'host' => env('DB_HOST', '127.0.0.1'),
46 | 'port' => env('DB_PORT', '3306'),
47 | 'database' => env('DB_DATABASE', 'laravel'),
48 | 'username' => env('DB_USERNAME', 'root'),
49 | 'password' => env('DB_PASSWORD', ''),
50 | 'unix_socket' => env('DB_SOCKET', ''),
51 | 'charset' => env('DB_CHARSET', 'utf8mb4'),
52 | 'collation' => env('DB_COLLATION', 'utf8mb4_0900_ai_ci'),
53 | 'prefix' => '',
54 | 'prefix_indexes' => true,
55 | 'strict' => true,
56 | 'engine' => null,
57 | 'options' => extension_loaded('pdo_mysql') ? array_filter([
58 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
59 | ]) : [],
60 | ],
61 |
62 | 'mariadb' => [
63 | 'driver' => 'mariadb',
64 | 'url' => env('DB_URL'),
65 | 'host' => env('DB_HOST', '127.0.0.1'),
66 | 'port' => env('DB_PORT', '3306'),
67 | 'database' => env('DB_DATABASE', 'laravel'),
68 | 'username' => env('DB_USERNAME', 'root'),
69 | 'password' => env('DB_PASSWORD', ''),
70 | 'unix_socket' => env('DB_SOCKET', ''),
71 | 'charset' => env('DB_CHARSET', 'utf8mb4'),
72 | 'collation' => env('DB_COLLATION', 'utf8mb4_uca1400_ai_ci'),
73 | 'prefix' => '',
74 | 'prefix_indexes' => true,
75 | 'strict' => true,
76 | 'engine' => null,
77 | 'options' => extension_loaded('pdo_mysql') ? array_filter([
78 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
79 | ]) : [],
80 | ],
81 |
82 | 'pgsql' => [
83 | 'driver' => 'pgsql',
84 | 'url' => env('DB_URL'),
85 | 'host' => env('DB_HOST', '127.0.0.1'),
86 | 'port' => env('DB_PORT', '5432'),
87 | 'database' => env('DB_DATABASE', 'laravel'),
88 | 'username' => env('DB_USERNAME', 'root'),
89 | 'password' => env('DB_PASSWORD', ''),
90 | 'charset' => env('DB_CHARSET', 'utf8'),
91 | 'prefix' => '',
92 | 'prefix_indexes' => true,
93 | 'search_path' => 'public',
94 | 'sslmode' => 'prefer',
95 | ],
96 |
97 | 'sqlsrv' => [
98 | 'driver' => 'sqlsrv',
99 | 'url' => env('DB_URL'),
100 | 'host' => env('DB_HOST', 'localhost'),
101 | 'port' => env('DB_PORT', '1433'),
102 | 'database' => env('DB_DATABASE', 'laravel'),
103 | 'username' => env('DB_USERNAME', 'root'),
104 | 'password' => env('DB_PASSWORD', ''),
105 | 'charset' => env('DB_CHARSET', 'utf8'),
106 | 'prefix' => '',
107 | 'prefix_indexes' => true,
108 | // 'encrypt' => env('DB_ENCRYPT', 'yes'),
109 | // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
110 | ],
111 |
112 | ],
113 |
114 | /*
115 | |--------------------------------------------------------------------------
116 | | Migration Repository Table
117 | |--------------------------------------------------------------------------
118 | |
119 | | This table keeps track of all the migrations that have already run for
120 | | your application. Using this information, we can determine which of
121 | | the migrations on disk haven't actually been run on the database.
122 | |
123 | */
124 |
125 | 'migrations' => [
126 | 'table' => 'migrations',
127 | 'update_date_on_publish' => true,
128 | ],
129 |
130 | /*
131 | |--------------------------------------------------------------------------
132 | | Redis Databases
133 | |--------------------------------------------------------------------------
134 | |
135 | | Redis is an open source, fast, and advanced key-value store that also
136 | | provides a richer body of commands than a typical key-value system
137 | | such as Memcached. You may define your connection settings here.
138 | |
139 | */
140 |
141 | 'redis' => [
142 |
143 | 'client' => env('REDIS_CLIENT', 'phpredis'),
144 |
145 | 'options' => [
146 | 'cluster' => env('REDIS_CLUSTER', 'redis'),
147 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
148 | ],
149 |
150 | 'default' => [
151 | 'url' => env('REDIS_URL'),
152 | 'host' => env('REDIS_HOST', '127.0.0.1'),
153 | 'username' => env('REDIS_USERNAME'),
154 | 'password' => env('REDIS_PASSWORD'),
155 | 'port' => env('REDIS_PORT', '6379'),
156 | 'database' => env('REDIS_DB', '0'),
157 | ],
158 |
159 | 'cache' => [
160 | 'url' => env('REDIS_URL'),
161 | 'host' => env('REDIS_HOST', '127.0.0.1'),
162 | 'username' => env('REDIS_USERNAME'),
163 | 'password' => env('REDIS_PASSWORD'),
164 | 'port' => env('REDIS_PORT', '6379'),
165 | 'database' => env('REDIS_CACHE_DB', '1'),
166 | ],
167 |
168 | ],
169 |
170 | ];
171 |
--------------------------------------------------------------------------------
/config/session.php:
--------------------------------------------------------------------------------
1 | env('SESSION_DRIVER', 'database'),
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | Session Lifetime
26 | |--------------------------------------------------------------------------
27 | |
28 | | Here you may specify the number of minutes that you wish the session
29 | | to be allowed to remain idle before it expires. If you want them
30 | | to expire immediately when the browser is closed then you may
31 | | indicate that via the expire_on_close configuration option.
32 | |
33 | */
34 |
35 | 'lifetime' => env('SESSION_LIFETIME', 120),
36 |
37 | 'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false),
38 |
39 | /*
40 | |--------------------------------------------------------------------------
41 | | Session Encryption
42 | |--------------------------------------------------------------------------
43 | |
44 | | This option allows you to easily specify that all of your session data
45 | | should be encrypted before it's stored. All encryption is performed
46 | | automatically by Laravel and you may use the session like normal.
47 | |
48 | */
49 |
50 | 'encrypt' => env('SESSION_ENCRYPT', false),
51 |
52 | /*
53 | |--------------------------------------------------------------------------
54 | | Session File Location
55 | |--------------------------------------------------------------------------
56 | |
57 | | When utilizing the "file" session driver, the session files are placed
58 | | on disk. The default storage location is defined here; however, you
59 | | are free to provide another location where they should be stored.
60 | |
61 | */
62 |
63 | 'files' => storage_path('framework/sessions'),
64 |
65 | /*
66 | |--------------------------------------------------------------------------
67 | | Session Database Connection
68 | |--------------------------------------------------------------------------
69 | |
70 | | When using the "database" or "redis" session drivers, you may specify a
71 | | connection that should be used to manage these sessions. This should
72 | | correspond to a connection in your database configuration options.
73 | |
74 | */
75 |
76 | 'connection' => env('SESSION_CONNECTION'),
77 |
78 | /*
79 | |--------------------------------------------------------------------------
80 | | Session Database Table
81 | |--------------------------------------------------------------------------
82 | |
83 | | When using the "database" session driver, you may specify the table to
84 | | be used to store sessions. Of course, a sensible default is defined
85 | | for you; however, you're welcome to change this to another table.
86 | |
87 | */
88 |
89 | 'table' => env('SESSION_TABLE', 'sessions'),
90 |
91 | /*
92 | |--------------------------------------------------------------------------
93 | | Session Cache Store
94 | |--------------------------------------------------------------------------
95 | |
96 | | When using one of the framework's cache driven session backends, you may
97 | | define the cache store which should be used to store the session data
98 | | between requests. This must match one of your defined cache stores.
99 | |
100 | | Affects: "apc", "dynamodb", "memcached", "redis"
101 | |
102 | */
103 |
104 | 'store' => env('SESSION_STORE'),
105 |
106 | /*
107 | |--------------------------------------------------------------------------
108 | | Session Sweeping Lottery
109 | |--------------------------------------------------------------------------
110 | |
111 | | Some session drivers must manually sweep their storage location to get
112 | | rid of old sessions from storage. Here are the chances that it will
113 | | happen on a given request. By default, the odds are 2 out of 100.
114 | |
115 | */
116 |
117 | 'lottery' => [2, 100],
118 |
119 | /*
120 | |--------------------------------------------------------------------------
121 | | Session Cookie Name
122 | |--------------------------------------------------------------------------
123 | |
124 | | Here you may change the name of the session cookie that is created by
125 | | the framework. Typically, you should not need to change this value
126 | | since doing so does not grant a meaningful security improvement.
127 | |
128 | |
129 | */
130 |
131 | 'cookie' => env(
132 | 'SESSION_COOKIE',
133 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
134 | ),
135 |
136 | /*
137 | |--------------------------------------------------------------------------
138 | | Session Cookie Path
139 | |--------------------------------------------------------------------------
140 | |
141 | | The session cookie path determines the path for which the cookie will
142 | | be regarded as available. Typically, this will be the root path of
143 | | your application, but you're free to change this when necessary.
144 | |
145 | */
146 |
147 | 'path' => env('SESSION_PATH', '/'),
148 |
149 | /*
150 | |--------------------------------------------------------------------------
151 | | Session Cookie Domain
152 | |--------------------------------------------------------------------------
153 | |
154 | | This value determines the domain and subdomains the session cookie is
155 | | available to. By default, the cookie will be available to the root
156 | | domain and all subdomains. Typically, this shouldn't be changed.
157 | |
158 | */
159 |
160 | 'domain' => env('SESSION_DOMAIN'),
161 |
162 | /*
163 | |--------------------------------------------------------------------------
164 | | HTTPS Only Cookies
165 | |--------------------------------------------------------------------------
166 | |
167 | | By setting this option to true, session cookies will only be sent back
168 | | to the server if the browser has a HTTPS connection. This will keep
169 | | the cookie from being sent to you when it can't be done securely.
170 | |
171 | */
172 |
173 | 'secure' => env('SESSION_SECURE_COOKIE'),
174 |
175 | /*
176 | |--------------------------------------------------------------------------
177 | | HTTP Access Only
178 | |--------------------------------------------------------------------------
179 | |
180 | | Setting this value to true will prevent JavaScript from accessing the
181 | | value of the cookie and the cookie will only be accessible through
182 | | the HTTP protocol. It's unlikely you should disable this option.
183 | |
184 | */
185 |
186 | 'http_only' => env('SESSION_HTTP_ONLY', true),
187 |
188 | /*
189 | |--------------------------------------------------------------------------
190 | | Same-Site Cookies
191 | |--------------------------------------------------------------------------
192 | |
193 | | This option determines how your cookies behave when cross-site requests
194 | | take place, and can be used to mitigate CSRF attacks. By default, we
195 | | will set this value to "lax" to permit secure cross-site requests.
196 | |
197 | | See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value
198 | |
199 | | Supported: "lax", "strict", "none", null
200 | |
201 | */
202 |
203 | 'same_site' => env('SESSION_SAME_SITE', 'lax'),
204 |
205 | /*
206 | |--------------------------------------------------------------------------
207 | | Partitioned Cookies
208 | |--------------------------------------------------------------------------
209 | |
210 | | Setting this value to true will tie the cookie to the top-level site for
211 | | a cross-site context. Partitioned cookies are accepted by the browser
212 | | when flagged "secure" and the Same-Site attribute is set to "none".
213 | |
214 | */
215 |
216 | 'partitioned' => env('SESSION_PARTITIONED_COOKIE', false),
217 |
218 | ];
219 |
--------------------------------------------------------------------------------
/resources/js/Layouts/AuthenticatedLayout.vue:
--------------------------------------------------------------------------------
1 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
45 |
46 |
47 |
48 |
49 | Dashboard
50 |
51 |
52 | Your Podcasts
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
67 | {{ $page.props.auth.user.name }}
68 |
69 |
75 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | Profile
87 |
88 | Log Out
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
101 |
102 |
112 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
133 |
134 |
135 | Dashboard
136 |
137 |
138 | Your Podcasts
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 | {{ $page.props.auth.user.name }}
147 |
148 |
{{ $page.props.auth.user.email }}
149 |
150 |
151 |
152 | Profile
153 |
154 | Log Out
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
176 |
177 |
178 | {{ notification.content }}
179 |
180 |
181 |
182 |
183 |
184 |
--------------------------------------------------------------------------------
/resources/js/Pages/Welcome.vue:
--------------------------------------------------------------------------------
1 |
28 |
29 |
30 |
31 |
32 |
37 |
40 |
41 |
42 |
55 |
56 |
61 | Dashboard
62 |
63 |
64 |
65 |
69 | Log in
70 |
71 |
72 |
77 | Register
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
90 |
91 |
97 |
102 |
105 |
106 |
107 |
108 |
109 |
112 |
118 |
122 |
126 |
127 |
128 |
129 |
130 |
Documentation
131 |
132 |
133 | Laravel has wonderful documentation covering every aspect of the framework.
134 | Whether you are a newcomer or have prior experience with Laravel, we
135 | recommend reading our documentation from beginning to end.
136 |
137 |
138 |
139 |
140 |
147 |
152 |
153 |
154 |
155 |
156 |
160 |
163 |
169 |
170 |
173 |
174 |
175 |
176 |
177 |
178 |
Laracasts
179 |
180 |
181 | Laracasts offers thousands of video tutorials on Laravel, PHP, and JavaScript
182 | development. Check them out, see for yourself, and massively level up your
183 | development skills in the process.
184 |
185 |
186 |
187 |
194 |
199 |
200 |
201 |
202 |
206 |
209 |
215 |
216 |
219 |
222 |
225 |
226 |
227 |
228 |
229 |
230 |
Laravel News
231 |
232 |
233 | Laravel News is a community driven portal and newsletter aggregating all of the
234 | latest and most important news in the Laravel ecosystem, including new package
235 | releases and tutorials.
236 |
237 |
238 |
239 |
246 |
251 |
252 |
253 |
254 |
257 |
260 |
266 |
267 |
270 |
271 |
272 |
273 |
274 |
275 |
Vibrant Ecosystem
276 |
277 |
278 | Laravel's robust library of first-party tools and libraries, such as
279 | Forge ,
284 | Vapor ,
289 | Nova , and
294 | Envoyer
299 | help you take your projects to the next level. Pair them with powerful open source
300 | libraries like
301 | Cashier ,
306 | Dusk ,
311 | Echo ,
316 | Horizon ,
321 | Sanctum ,
326 | Telescope , and more.
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 | Laravel v{{ laravelVersion }} (PHP v{{ phpVersion }})
339 |
340 |
341 |
342 |
343 |
344 |
--------------------------------------------------------------------------------