├── public ├── favicon.ico ├── robots.txt ├── .htaccess └── index.php ├── database ├── .gitignore ├── seeders │ ├── PostSeeder.php │ ├── CreatorSeeder.php │ └── DatabaseSeeder.php ├── factories │ ├── CreatorFactory.php │ ├── PostFactory.php │ └── UserFactory.php └── migrations │ ├── 2014_10_12_100000_create_password_reset_tokens_table.php │ ├── 2023_02_28_114727_create_creators_table.php │ ├── 2023_02_28_114728_create_posts_table.php │ ├── 2019_08_19_000000_create_failed_jobs_table.php │ ├── 2023_03_01_131819_create_sessions_table.php │ ├── 2019_12_14_000001_create_personal_access_tokens_table.php │ ├── 2014_10_12_000000_create_users_table.php │ └── 2014_10_12_200000_add_two_factor_columns_to_users_table.php ├── bootstrap ├── cache │ └── .gitignore └── 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 ├── markdown │ ├── policy.md │ └── terms.md ├── js │ ├── Components │ │ ├── SectionBorder.vue │ │ ├── InputError.vue │ │ ├── InputLabel.vue │ │ ├── AuthenticationCard.vue │ │ ├── ActionMessage.vue │ │ ├── ApplicationMark.vue │ │ ├── SectionTitle.vue │ │ ├── DangerButton.vue │ │ ├── SecondaryButton.vue │ │ ├── PrimaryButton.vue │ │ ├── ActionSection.vue │ │ ├── TextInput.vue │ │ ├── AuthenticationCardLogo.vue │ │ ├── Checkbox.vue │ │ ├── NavLink.vue │ │ ├── DropdownLink.vue │ │ ├── DialogModal.vue │ │ ├── ResponsiveNavLink.vue │ │ ├── FormSection.vue │ │ ├── ConfirmationModal.vue │ │ ├── Dropdown.vue │ │ ├── Banner.vue │ │ ├── Modal.vue │ │ ├── ApplicationLogo.vue │ │ └── ConfirmsPassword.vue │ ├── Pages │ │ ├── Dashboard.vue │ │ ├── PrivacyPolicy.vue │ │ ├── TermsOfService.vue │ │ ├── API │ │ │ └── Index.vue │ │ ├── Auth │ │ │ ├── ForgotPassword.vue │ │ │ ├── ConfirmPassword.vue │ │ │ ├── VerifyEmail.vue │ │ │ ├── ResetPassword.vue │ │ │ ├── Login.vue │ │ │ ├── TwoFactorChallenge.vue │ │ │ └── Register.vue │ │ └── Profile │ │ │ ├── Show.vue │ │ │ └── Partials │ │ │ ├── UpdatePasswordForm.vue │ │ │ └── DeleteUserForm.vue │ ├── app.js │ └── bootstrap.js └── views │ ├── view.blade.php │ ├── app.blade.php │ ├── user_info.blade.php │ ├── emails │ └── team-invitation.blade.php │ ├── users.blade.php │ ├── create.blade.php │ ├── update.blade.php │ └── posts.blade.php ├── postcss.config.js ├── tests ├── TestCase.php ├── Unit │ └── ExampleTest.php ├── Feature │ ├── ExampleTest.php │ ├── BrowserSessionsTest.php │ ├── ProfileInformationTest.php │ ├── DeleteApiTokenTest.php │ ├── CreateApiTokenTest.php │ ├── AuthenticationTest.php │ ├── DeleteAccountTest.php │ ├── PasswordConfirmationTest.php │ ├── ApiTokenPermissionsTest.php │ ├── UpdatePasswordTest.php │ ├── RegistrationTest.php │ ├── TwoFactorAuthenticationSettingsTest.php │ ├── EmailVerificationTest.php │ └── PasswordResetTest.php └── CreatesApplication.php ├── .gitattributes ├── .gitignore ├── .editorconfig ├── app ├── Http │ ├── Controllers │ │ ├── Controller.php │ │ └── post_controller.php │ ├── Middleware │ │ ├── EncryptCookies.php │ │ ├── VerifyCsrfToken.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── TrimStrings.php │ │ ├── TrustHosts.php │ │ ├── Authenticate.php │ │ ├── ValidateSignature.php │ │ ├── TrustProxies.php │ │ ├── RedirectIfAuthenticated.php │ │ └── HandleInertiaRequests.php │ └── Kernel.php ├── Actions │ ├── Jetstream │ │ └── DeleteUser.php │ └── Fortify │ │ ├── PasswordValidationRules.php │ │ ├── ResetUserPassword.php │ │ ├── UpdateUserPassword.php │ │ ├── CreateNewUser.php │ │ └── UpdateUserProfileInformation.php ├── Models │ ├── post.php │ ├── creator.php │ └── User.php ├── Providers │ ├── BroadcastServiceProvider.php │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── EventServiceProvider.php │ ├── JetstreamServiceProvider.php │ ├── RouteServiceProvider.php │ └── FortifyServiceProvider.php ├── Console │ └── Kernel.php └── Exceptions │ └── Handler.php ├── vite.config.js ├── package.json ├── routes ├── channels.php ├── api.php ├── console.php └── web.php ├── tailwind.config.js ├── config ├── cors.php ├── view.php ├── services.php ├── hashing.php ├── broadcasting.php ├── sanctum.php ├── filesystems.php ├── jetstream.php ├── queue.php ├── cache.php ├── logging.php ├── mail.php ├── auth.php └── fortify.php ├── phpunit.xml ├── .env.example ├── artisan ├── composer.json └── README.md /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 | -------------------------------------------------------------------------------- /resources/markdown/policy.md: -------------------------------------------------------------------------------- 1 | # Privacy Policy 2 | 3 | Edit this file to define the privacy policy for your application. 4 | -------------------------------------------------------------------------------- /resources/markdown/terms.md: -------------------------------------------------------------------------------- 1 | # Terms of Service 2 | 3 | Edit this file to define the terms of service for your application. 4 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /resources/js/Components/SectionBorder.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | 2 | defineProps({ 3 | message: String, 4 | }); 5 | 6 | 7 | 14 | -------------------------------------------------------------------------------- /resources/js/Components/InputLabel.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /tests/Unit/ExampleTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /database/seeders/PostSeeder.php: -------------------------------------------------------------------------------- 1 | count(50)->create(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /resources/js/Components/AuthenticationCard.vue: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /database/seeders/CreatorSeeder.php: -------------------------------------------------------------------------------- 1 | count(50)->create(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /resources/js/Components/ActionMessage.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 16 | 17 | $response->assertStatus(200); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Actions/Jetstream/DeleteUser.php: -------------------------------------------------------------------------------- 1 | deleteProfilePhoto(); 16 | $user->tokens->each->delete(); 17 | $user->delete(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Models/post.php: -------------------------------------------------------------------------------- 1 | belongsTo(creator::class); 16 | } 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | hasMany(post::class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/Http/Middleware/PreventRequestsDuringMaintenance.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | 'current_password', 16 | 'password', 17 | 'password_confirmation', 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 18 | 19 | return $app; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustHosts.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public function hosts(): array 15 | { 16 | return [ 17 | $this->allSubdomainsOfApplicationUrl(), 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /resources/js/Components/ApplicationMark.vue: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /app/Actions/Fortify/PasswordValidationRules.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected function passwordRules(): array 15 | { 16 | return ['required', 'string', new Password, 'confirmed']; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson() ? null : route('login'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /resources/js/Components/SectionTitle.vue: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 'fbclid', 16 | // 'utm_campaign', 17 | // 'utm_content', 18 | // 'utm_medium', 19 | // 'utm_source', 20 | // 'utm_term', 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /resources/js/Components/DangerButton.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /resources/js/Components/SecondaryButton.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 16 | 17 | // \App\Models\User::factory()->create([ 18 | // 'name' => 'Test User', 19 | // 'email' => 'test@example.com', 20 | // ]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /resources/js/Components/PrimaryButton.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "vite", 5 | "build": "vite build" 6 | }, 7 | "devDependencies": { 8 | "@inertiajs/vue3": "^1.0.0", 9 | "@tailwindcss/forms": "^0.5.2", 10 | "@tailwindcss/typography": "^0.5.2", 11 | "@vitejs/plugin-vue": "^4.0.0", 12 | "autoprefixer": "^10.4.7", 13 | "axios": "^1.1.2", 14 | "laravel-vite-plugin": "^0.7.2", 15 | "postcss": "^8.4.14", 16 | "tailwindcss": "^3.1.0", 17 | "vite": "^4.0.0", 18 | "vue": "^3.2.31" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /tests/Feature/BrowserSessionsTest.php: -------------------------------------------------------------------------------- 1 | actingAs($user = User::factory()->create()); 16 | 17 | $response = $this->delete('/user/other-browser-sessions', [ 18 | 'password' => 'password', 19 | ]); 20 | 21 | $response->assertSessionHasNoErrors(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 18 | return $request->user(); 19 | }); 20 | -------------------------------------------------------------------------------- /database/factories/CreatorFactory.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | class CreatorFactory extends Factory 11 | { 12 | /** 13 | * Define the model's default state. 14 | * 15 | * @return array 16 | */ 17 | public function definition(): array 18 | { 19 | return [ 20 | 'name' => fake()->name(), 21 | 'email' => fake()->email(), 22 | 'password' => fake()->password(), 23 | ]; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->purpose('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /resources/views/view.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | @foreach($posts as $posts) 11 |

post info

12 |

Title:-{{$posts->title}}

13 |

Description :- {{$posts->description}}

14 | 15 |

post creator info

16 |

Name:- {{$posts->creator->name}}

17 |

Email :- {{$posts->creator->email}}

18 |

Created at :- {{$posts->created_at}}

19 | @endforeach 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 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 16 | } 17 | 18 | /** 19 | * Register the commands for the application. 20 | */ 21 | protected function commands(): void 22 | { 23 | $this->load(__DIR__.'/Commands'); 24 | 25 | require base_path('routes/console.php'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /database/factories/PostFactory.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | class PostFactory extends Factory 11 | { 12 | /** 13 | * Define the model's default state. 14 | * 15 | * @return array 16 | */ 17 | public function definition(): array 18 | { 19 | return [ 20 | 'title' => fake()->title(), 21 | 'creator_id' => Creator::inRandomOrder()->first()->id, 22 | 'description' => fake()->slug(), 23 | ]; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | protected $policies = [ 16 | // 'App\Models\Model' => 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | */ 22 | public function boot(): void 23 | { 24 | // 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /resources/js/Components/ActionSection.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | -------------------------------------------------------------------------------- /resources/js/Components/TextInput.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 29 | -------------------------------------------------------------------------------- /resources/js/Pages/Dashboard.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 23 | -------------------------------------------------------------------------------- /resources/js/Components/AuthenticationCardLogo.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 18 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | const defaultTheme = require('tailwindcss/defaultTheme'); 2 | 3 | /** @type {import('tailwindcss').Config} */ 4 | module.exports = { 5 | content: [ 6 | './vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php', 7 | './vendor/laravel/jetstream/**/*.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: [require('@tailwindcss/forms'), require('@tailwindcss/typography')], 22 | }; 23 | -------------------------------------------------------------------------------- /tests/Feature/ProfileInformationTest.php: -------------------------------------------------------------------------------- 1 | actingAs($user = User::factory()->create()); 16 | 17 | $response = $this->put('/user/profile-information', [ 18 | 'name' => 'Test Name', 19 | 'email' => 'test@example.com', 20 | ]); 21 | 22 | $this->assertEquals('Test Name', $user->fresh()->name); 23 | $this->assertEquals('test@example.com', $user->fresh()->email); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | |string|null 14 | */ 15 | protected $proxies; 16 | 17 | /** 18 | * The headers that should be used to detect proxies. 19 | * 20 | * @var int 21 | */ 22 | protected $headers = 23 | Request::HEADER_X_FORWARDED_FOR | 24 | Request::HEADER_X_FORWARDED_HOST | 25 | Request::HEADER_X_FORWARDED_PORT | 26 | Request::HEADER_X_FORWARDED_PROTO | 27 | Request::HEADER_X_FORWARDED_AWS_ELB; 28 | } 29 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /resources/js/Pages/PrivacyPolicy.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 25 | -------------------------------------------------------------------------------- /resources/js/Pages/TermsOfService.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 25 | -------------------------------------------------------------------------------- /resources/js/Components/Checkbox.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 29 | 37 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php: -------------------------------------------------------------------------------- 1 | string('email')->primary(); 16 | $table->string('token'); 17 | $table->timestamp('created_at')->nullable(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | */ 24 | public function down(): void 25 | { 26 | Schema::dropIfExists('password_reset_tokens'); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /database/migrations/2023_02_28_114727_create_creators_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('name'); 17 | $table->string('email'); 18 | $table->string('password'); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | */ 26 | public function down(): void 27 | { 28 | Schema::dropIfExists('creators'); 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /resources/views/user_info.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | {{--

{{$user->post[0]->title}}

--}} 11 | 12 |

user info

13 |

name:-{{$user->name}}

14 |

email :- {{$user->email}}

15 |

posts

16 | @foreach($user->post as $post) 17 |

title:- {{$post->title}}

18 |

creator name:- {{$post->creator->name}}

19 |

description :- {{$post->description}}

20 |

creator :- {{$post->created_at}}

21 |

********************************

22 | @endforeach 23 | 24 | 25 | -------------------------------------------------------------------------------- /database/migrations/2023_02_28_114728_create_posts_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('title'); 17 | $table->foreignId('creator_id')->constrained(); 18 | $table->text('description'); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | */ 26 | public function down(): void 27 | { 28 | Schema::dropIfExists('posts'); 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /app/Actions/Fortify/ResetUserPassword.php: -------------------------------------------------------------------------------- 1 | $input 18 | */ 19 | public function reset(creator $user, array $input): void 20 | { 21 | Validator::make($input, [ 22 | 'password' => $this->passwordRules(), 23 | ])->validate(); 24 | 25 | $user->forceFill([ 26 | 'password' => Hash::make($input['password']), 27 | ])->save(); 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/dist/vue.m'; 8 | 9 | const appName = window.document.getElementsByTagName('title')[0]?.innerText || '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, Ziggy) 18 | .mount(el); 19 | }, 20 | progress: { 21 | color: '#4B5563', 22 | }, 23 | }); 24 | -------------------------------------------------------------------------------- /resources/js/Components/NavLink.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 24 | return redirect(RouteServiceProvider::HOME); 25 | } 26 | } 27 | 28 | return $next($request); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /database/migrations/2019_08_19_000000_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('uuid')->unique(); 17 | $table->text('connection'); 18 | $table->text('queue'); 19 | $table->longText('payload'); 20 | $table->longText('exception'); 21 | $table->timestamp('failed_at')->useCurrent(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('failed_jobs'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2023_03_01_131819_create_sessions_table.php: -------------------------------------------------------------------------------- 1 | string('id')->primary(); 16 | $table->foreignId('user_id')->nullable()->index(); 17 | $table->string('ip_address', 45)->nullable(); 18 | $table->text('user_agent')->nullable(); 19 | $table->longText('payload'); 20 | $table->integer('last_activity')->index(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | */ 27 | public function down(): void 28 | { 29 | Schema::dropIfExists('sessions'); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /resources/js/Pages/API/Index.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 31 | -------------------------------------------------------------------------------- /resources/js/Components/DropdownLink.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 25 | -------------------------------------------------------------------------------- /config/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*', 'sanctum/csrf-cookie'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => [], 29 | 30 | 'max_age' => 0, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /tests/Feature/DeleteApiTokenTest.php: -------------------------------------------------------------------------------- 1 | markTestSkipped('API support is not enabled.'); 19 | 20 | return; 21 | } 22 | 23 | $this->actingAs($user = User::factory()->withPersonalTeam()->create()); 24 | 25 | $token = $user->tokens()->create([ 26 | 'name' => 'Test Token', 27 | 'token' => Str::random(40), 28 | 'abilities' => ['create', 'read'], 29 | ]); 30 | 31 | $response = $this->delete('/user/api-tokens/'.$token->id); 32 | 33 | $this->assertCount(0, $user->fresh()->tokens); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /resources/views/emails/team-invitation.blade.php: -------------------------------------------------------------------------------- 1 | @component('mail::message') 2 | {{ __('You have been invited to join the :team team!', ['team' => $invitation->team->name]) }} 3 | 4 | @if (Laravel\Fortify\Features::enabled(Laravel\Fortify\Features::registration())) 5 | {{ __('If you do not have an account, you may create one by clicking the button below. After creating an account, you may click the invitation acceptance button in this email to accept the team invitation:') }} 6 | 7 | @component('mail::button', ['url' => route('register')]) 8 | {{ __('Create Account') }} 9 | @endcomponent 10 | 11 | {{ __('If you already have an account, you may accept this invitation by clicking the button below:') }} 12 | 13 | @else 14 | {{ __('You may accept this invitation by clicking the button below:') }} 15 | @endif 16 | 17 | 18 | @component('mail::button', ['url' => $acceptUrl]) 19 | {{ __('Accept Invitation') }} 20 | @endcomponent 21 | 22 | {{ __('If you did not expect to receive an invitation to this team, you may discard this email.') }} 23 | @endcomponent 24 | -------------------------------------------------------------------------------- /database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->morphs('tokenable'); 17 | $table->string('name'); 18 | $table->string('token', 64)->unique(); 19 | $table->text('abilities')->nullable(); 20 | $table->timestamp('last_used_at')->nullable(); 21 | $table->timestamp('expires_at')->nullable(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | */ 29 | public function down(): void 30 | { 31 | Schema::dropIfExists('personal_access_tokens'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | > 16 | */ 17 | protected $listen = [ 18 | Registered::class => [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | */ 26 | public function boot(): void 27 | { 28 | // 29 | } 30 | 31 | /** 32 | * Determine if events and listeners should be automatically discovered. 33 | */ 34 | public function shouldDiscoverEvents(): bool 35 | { 36 | return false; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('name'); 17 | $table->string('email')->unique(); 18 | $table->timestamp('email_verified_at')->nullable(); 19 | $table->string('password'); 20 | $table->rememberToken(); 21 | $table->foreignId('current_team_id')->nullable(); 22 | $table->string('profile_photo_path', 2048)->nullable(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | */ 30 | public function down(): void 31 | { 32 | Schema::dropIfExists('users'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /app/Providers/JetstreamServiceProvider.php: -------------------------------------------------------------------------------- 1 | configurePermissions(); 25 | 26 | Jetstream::deleteUsersUsing(DeleteUser::class); 27 | } 28 | 29 | /** 30 | * Configure the permissions that are available within the application. 31 | */ 32 | protected function configurePermissions(): void 33 | { 34 | Jetstream::defaultApiTokenPermissions(['read']); 35 | 36 | Jetstream::permissions([ 37 | 'create', 38 | 'read', 39 | 'update', 40 | 'delete', 41 | ]); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Actions/Fortify/UpdateUserPassword.php: -------------------------------------------------------------------------------- 1 | $input 18 | */ 19 | public function update(creator $user, array $input): void 20 | { 21 | Validator::make($input, [ 22 | 'current_password' => ['required', 'string', 'current_password:web'], 23 | 'password' => $this->passwordRules(), 24 | ], [ 25 | 'current_password.current_password' => __('The provided password does not match your current password.'), 26 | ])->validateWithBag('updatePassword'); 27 | 28 | $user->forceFill([ 29 | 'password' => Hash::make($input['password']), 30 | ])->save(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /resources/js/Components/DialogModal.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 48 | -------------------------------------------------------------------------------- /resources/js/Components/ResponsiveNavLink.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 29 | -------------------------------------------------------------------------------- /tests/Feature/CreateApiTokenTest.php: -------------------------------------------------------------------------------- 1 | markTestSkipped('API support is not enabled.'); 18 | 19 | return; 20 | } 21 | 22 | $this->actingAs($user = User::factory()->withPersonalTeam()->create()); 23 | 24 | $response = $this->post('/user/api-tokens', [ 25 | 'name' => 'Test Token', 26 | 'permissions' => [ 27 | 'read', 28 | 'update', 29 | ], 30 | ]); 31 | 32 | $this->assertCount(1, $user->fresh()->tokens); 33 | $this->assertEquals('Test Token', $user->fresh()->tokens->first()->name); 34 | $this->assertTrue($user->fresh()->tokens->first()->can('read')); 35 | $this->assertFalse($user->fresh()->tokens->first()->can('delete')); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/Actions/Fortify/CreateNewUser.php: -------------------------------------------------------------------------------- 1 | $input 19 | */ 20 | public function create(array $input): creator 21 | { 22 | Validator::make($input, [ 23 | 'name' => ['required', 'string', 'max:255'], 24 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 25 | 'password' => $this->passwordRules(), 26 | 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '', 27 | ])->validate(); 28 | 29 | return creator::create([ 30 | 'name' => $input['name'], 31 | 'email' => $input['email'], 32 | 'password' => Hash::make($input['password']), 33 | ]); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /app/Http/Middleware/HandleInertiaRequests.php: -------------------------------------------------------------------------------- 1 | , \Psr\Log\LogLevel::*> 14 | */ 15 | protected $levels = [ 16 | // 17 | ]; 18 | 19 | /** 20 | * A list of the exception types that are not reported. 21 | * 22 | * @var array> 23 | */ 24 | protected $dontReport = [ 25 | // 26 | ]; 27 | 28 | /** 29 | * A list of the inputs that are never flashed to the session on validation exceptions. 30 | * 31 | * @var array 32 | */ 33 | protected $dontFlash = [ 34 | 'current_password', 35 | 'password', 36 | 'password_confirmation', 37 | ]; 38 | 39 | /** 40 | * Register the exception handling callbacks for the application. 41 | */ 42 | public function register(): void 43 | { 44 | $this->reportable(function (Throwable $e) { 45 | // 46 | }); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /resources/views/users.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | Document 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | @foreach($creators as $creator) 24 | 25 | 26 | 27 | 28 | 29 | 33 | 34 | @endforeach 35 | 36 | 37 |
nameemailcreated atActions
{{$creator->name}}{{$creator->email}}{{$creator->created_at}} 30 | 31 | 32 |
38 |
39 | 40 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/Feature/AuthenticationTest.php: -------------------------------------------------------------------------------- 1 | get('/login'); 17 | 18 | $response->assertStatus(200); 19 | } 20 | 21 | public function test_users_can_authenticate_using_the_login_screen(): void 22 | { 23 | $user = User::factory()->create(); 24 | 25 | $response = $this->post('/login', [ 26 | 'email' => $user->email, 27 | 'password' => 'password', 28 | ]); 29 | 30 | $this->assertAuthenticated(); 31 | $response->assertRedirect(RouteServiceProvider::HOME); 32 | } 33 | 34 | public function test_users_can_not_authenticate_with_invalid_password(): void 35 | { 36 | $user = User::factory()->create(); 37 | 38 | $this->post('/login', [ 39 | 'email' => $user->email, 40 | 'password' => 'wrong-password', 41 | ]); 42 | 43 | $this->assertGuest(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | LOG_DEPRECATIONS_CHANNEL=null 9 | LOG_LEVEL=debug 10 | 11 | DB_CONNECTION=mysql 12 | DB_HOST=127.0.0.1 13 | DB_PORT=3306 14 | DB_DATABASE=first_project 15 | DB_USERNAME=root 16 | DB_PASSWORD= 17 | 18 | BROADCAST_DRIVER=log 19 | CACHE_DRIVER=file 20 | FILESYSTEM_DISK=local 21 | QUEUE_CONNECTION=sync 22 | SESSION_DRIVER=database 23 | SESSION_LIFETIME=120 24 | 25 | MEMCACHED_HOST=127.0.0.1 26 | 27 | REDIS_HOST=127.0.0.1 28 | REDIS_PASSWORD=null 29 | REDIS_PORT=6379 30 | 31 | MAIL_MAILER=smtp 32 | MAIL_HOST=mailpit 33 | MAIL_PORT=1025 34 | MAIL_USERNAME=null 35 | MAIL_PASSWORD=null 36 | MAIL_ENCRYPTION=null 37 | MAIL_FROM_ADDRESS="hello@example.com" 38 | MAIL_FROM_NAME="${APP_NAME}" 39 | 40 | AWS_ACCESS_KEY_ID= 41 | AWS_SECRET_ACCESS_KEY= 42 | AWS_DEFAULT_REGION=us-east-1 43 | AWS_BUCKET= 44 | AWS_USE_PATH_STYLE_ENDPOINT=false 45 | 46 | PUSHER_APP_ID= 47 | PUSHER_APP_KEY= 48 | PUSHER_APP_SECRET= 49 | PUSHER_HOST= 50 | PUSHER_PORT=443 51 | PUSHER_SCHEME=https 52 | PUSHER_APP_CLUSTER=mt1 53 | 54 | VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 55 | VITE_PUSHER_HOST="${PUSHER_HOST}" 56 | VITE_PUSHER_PORT="${PUSHER_PORT}" 57 | VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" 58 | VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 59 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | 'scheme' => 'https', 22 | ], 23 | 24 | 'postmark' => [ 25 | 'token' => env('POSTMARK_TOKEN'), 26 | ], 27 | 28 | 'ses' => [ 29 | 'key' => env('AWS_ACCESS_KEY_ID'), 30 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 31 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 32 | ], 33 | 'github' => [ 34 | 'client_id' => env('GITHUB_CLIENT_ID'), 35 | 'client_secret' => env('GITHUB_CLIENT_SECRET'), 36 | 'redirect' => 'http://example.com/callback-url', 37 | ], 38 | 39 | ]; 40 | -------------------------------------------------------------------------------- /tests/Feature/DeleteAccountTest.php: -------------------------------------------------------------------------------- 1 | markTestSkipped('Account deletion is not enabled.'); 18 | 19 | return; 20 | } 21 | 22 | $this->actingAs($user = User::factory()->create()); 23 | 24 | $response = $this->delete('/user', [ 25 | 'password' => 'password', 26 | ]); 27 | 28 | $this->assertNull($user->fresh()); 29 | } 30 | 31 | public function test_correct_password_must_be_provided_before_account_can_be_deleted(): void 32 | { 33 | if (! Features::hasAccountDeletionFeatures()) { 34 | $this->markTestSkipped('Account deletion is not enabled.'); 35 | 36 | return; 37 | } 38 | 39 | $this->actingAs($user = User::factory()->create()); 40 | 41 | $response = $this->delete('/user', [ 42 | 'password' => 'wrong-password', 43 | ]); 44 | 45 | $this->assertNotNull($user->fresh()); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/Feature/PasswordConfirmationTest.php: -------------------------------------------------------------------------------- 1 | withPersonalTeam()->create(); 17 | 18 | $response = $this->actingAs($user)->get('/user/confirm-password'); 19 | 20 | $response->assertStatus(200); 21 | } 22 | 23 | public function test_password_can_be_confirmed(): void 24 | { 25 | $user = User::factory()->create(); 26 | 27 | $response = $this->actingAs($user)->post('/user/confirm-password', [ 28 | 'password' => 'password', 29 | ]); 30 | 31 | $response->assertRedirect(); 32 | $response->assertSessionHasNoErrors(); 33 | } 34 | 35 | public function test_password_is_not_confirmed_with_invalid_password(): void 36 | { 37 | $user = User::factory()->create(); 38 | 39 | $response = $this->actingAs($user)->post('/user/confirm-password', [ 40 | 'password' => 'wrong-password', 41 | ]); 42 | 43 | $response->assertSessionHasErrors(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | /** 2 | * We'll load the axios HTTP library which allows us to easily issue requests 3 | * to our Laravel back-end. This library automatically handles sending the 4 | * CSRF token as a header based on the value of the "XSRF" token cookie. 5 | */ 6 | 7 | import axios from 'axios'; 8 | window.axios = axios; 9 | 10 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 11 | 12 | /** 13 | * Echo exposes an expressive API for subscribing to channels and listening 14 | * for events that are broadcast by Laravel. Echo and event broadcasting 15 | * allows your team to easily build robust real-time web applications. 16 | */ 17 | 18 | // import Echo from 'laravel-echo'; 19 | 20 | // import Pusher from 'pusher-js'; 21 | // window.Pusher = Pusher; 22 | 23 | // window.Echo = new Echo({ 24 | // broadcaster: 'pusher', 25 | // key: import.meta.env.VITE_PUSHER_APP_KEY, 26 | // cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1', 27 | // wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`, 28 | // wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80, 29 | // wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443, 30 | // forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https', 31 | // enabledTransports: ['ws', 'wss'], 32 | // }); 33 | -------------------------------------------------------------------------------- /tests/Feature/ApiTokenPermissionsTest.php: -------------------------------------------------------------------------------- 1 | markTestSkipped('API support is not enabled.'); 19 | 20 | return; 21 | } 22 | 23 | $this->actingAs($user = User::factory()->withPersonalTeam()->create()); 24 | 25 | $token = $user->tokens()->create([ 26 | 'name' => 'Test Token', 27 | 'token' => Str::random(40), 28 | 'abilities' => ['create', 'read'], 29 | ]); 30 | 31 | $response = $this->put('/user/api-tokens/'.$token->id, [ 32 | 'name' => $token->name, 33 | 'permissions' => [ 34 | 'delete', 35 | 'missing-permission', 36 | ], 37 | ]); 38 | 39 | $this->assertTrue($user->fresh()->tokens->first()->can('delete')); 40 | $this->assertFalse($user->fresh()->tokens->first()->can('read')); 41 | $this->assertFalse($user->fresh()->tokens->first()->can('missing-permission')); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /resources/js/Components/FormSection.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 39 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | configureRateLimiting(); 28 | 29 | $this->routes(function () { 30 | Route::middleware('api') 31 | ->prefix('api') 32 | ->group(base_path('routes/api.php')); 33 | 34 | Route::middleware('web') 35 | ->group(base_path('routes/web.php')); 36 | }); 37 | } 38 | 39 | /** 40 | * Configure the rate limiters for the application. 41 | */ 42 | protected function configureRateLimiting(): void 43 | { 44 | RateLimiter::for('api', function (Request $request) { 45 | return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); 46 | }); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/Providers/FortifyServiceProvider.php: -------------------------------------------------------------------------------- 1 | email; 37 | 38 | return Limit::perMinute(5)->by($email.$request->ip()); 39 | }); 40 | 41 | RateLimiter::for('two-factor', function (Request $request) { 42 | return Limit::perMinute(5)->by($request->session()->get('login.id')); 43 | }); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_200000_add_two_factor_columns_to_users_table.php: -------------------------------------------------------------------------------- 1 | text('two_factor_secret') 17 | ->after('password') 18 | ->nullable(); 19 | 20 | $table->text('two_factor_recovery_codes') 21 | ->after('two_factor_secret') 22 | ->nullable(); 23 | 24 | if (Fortify::confirmsTwoFactorAuthentication()) { 25 | $table->timestamp('two_factor_confirmed_at') 26 | ->after('two_factor_recovery_codes') 27 | ->nullable(); 28 | } 29 | }); 30 | } 31 | 32 | /** 33 | * Reverse the migrations. 34 | */ 35 | public function down(): void 36 | { 37 | Schema::table('users', function (Blueprint $table) { 38 | $table->dropColumn(array_merge([ 39 | 'two_factor_secret', 40 | 'two_factor_recovery_codes', 41 | ], Fortify::confirmsTwoFactorAuthentication() ? [ 42 | 'two_factor_confirmed_at', 43 | ] : [])); 44 | }); 45 | } 46 | }; 47 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | protected $fillable = [ 27 | 'name', 28 | 'email', 29 | 'password', 30 | ]; 31 | 32 | /** 33 | * The attributes that should be hidden for serialization. 34 | * 35 | * @var array 36 | */ 37 | protected $hidden = [ 38 | 'password', 39 | 'remember_token', 40 | 'two_factor_recovery_codes', 41 | 'two_factor_secret', 42 | ]; 43 | 44 | /** 45 | * The attributes that should be cast. 46 | * 47 | * @var array 48 | */ 49 | protected $casts = [ 50 | 'email_verified_at' => 'datetime', 51 | ]; 52 | 53 | /** 54 | * The accessors to append to the model's array form. 55 | * 56 | * @var array 57 | */ 58 | protected $appends = [ 59 | 'profile_photo_url', 60 | ]; 61 | } 62 | -------------------------------------------------------------------------------- /resources/views/create.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 10 | 11 | 12 | 13 |
14 |
15 | @csrf 16 |
17 | 18 | 19 | @error('title') 20 |
{{ $message }}
21 | @enderror 22 |
23 |
24 | 25 | 26 | 27 | 28 | @error('description') 29 |
{{ $message }}
30 | @enderror 31 |
32 | 33 | {{--
34 | 35 | 36 | 37 |
--}} 38 | 39 | 40 |
41 |
42 | 43 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 65536, 48 | 'threads' => 1, 49 | 'time' => 4, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /tests/Feature/UpdatePasswordTest.php: -------------------------------------------------------------------------------- 1 | actingAs($user = User::factory()->create()); 17 | 18 | $response = $this->put('/user/password', [ 19 | 'current_password' => 'password', 20 | 'password' => 'new-password', 21 | 'password_confirmation' => 'new-password', 22 | ]); 23 | 24 | $this->assertTrue(Hash::check('new-password', $user->fresh()->password)); 25 | } 26 | 27 | public function test_current_password_must_be_correct(): void 28 | { 29 | $this->actingAs($user = User::factory()->create()); 30 | 31 | $response = $this->put('/user/password', [ 32 | 'current_password' => 'wrong-password', 33 | 'password' => 'new-password', 34 | 'password_confirmation' => 'new-password', 35 | ]); 36 | 37 | $response->assertSessionHasErrors(); 38 | 39 | $this->assertTrue(Hash::check('password', $user->fresh()->password)); 40 | } 41 | 42 | public function test_new_passwords_must_match(): void 43 | { 44 | $this->actingAs($user = User::factory()->create()); 45 | 46 | $response = $this->put('/user/password', [ 47 | 'current_password' => 'password', 48 | 'password' => 'new-password', 49 | 'password_confirmation' => 'wrong-password', 50 | ]); 51 | 52 | $response->assertSessionHasErrors(); 53 | 54 | $this->assertTrue(Hash::check('password', $user->fresh()->password)); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /tests/Feature/RegistrationTest.php: -------------------------------------------------------------------------------- 1 | markTestSkipped('Registration support is not enabled.'); 19 | 20 | return; 21 | } 22 | 23 | $response = $this->get('/register'); 24 | 25 | $response->assertStatus(200); 26 | } 27 | 28 | public function test_registration_screen_cannot_be_rendered_if_support_is_disabled(): void 29 | { 30 | if (Features::enabled(Features::registration())) { 31 | $this->markTestSkipped('Registration support is enabled.'); 32 | 33 | return; 34 | } 35 | 36 | $response = $this->get('/register'); 37 | 38 | $response->assertStatus(404); 39 | } 40 | 41 | public function test_new_users_can_register(): void 42 | { 43 | if (! Features::enabled(Features::registration())) { 44 | $this->markTestSkipped('Registration support is not enabled.'); 45 | 46 | return; 47 | } 48 | 49 | $response = $this->post('/register', [ 50 | 'name' => 'Test User', 51 | 'email' => 'test@example.com', 52 | 'password' => 'password', 53 | 'password_confirmation' => 'password', 54 | 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature(), 55 | ]); 56 | 57 | $this->assertAuthenticated(); 58 | $response->assertRedirect(RouteServiceProvider::HOME); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class); 50 | 51 | $response = $kernel->handle( 52 | $request = Request::capture() 53 | )->send(); 54 | 55 | $kernel->terminate($request, $response); 56 | -------------------------------------------------------------------------------- /app/Actions/Fortify/UpdateUserProfileInformation.php: -------------------------------------------------------------------------------- 1 | $input 17 | */ 18 | public function update(creator $user, array $input): void 19 | { 20 | Validator::make($input, [ 21 | 'name' => ['required', 'string', 'max:255'], 22 | 'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)], 23 | 'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'], 24 | ])->validateWithBag('updateProfileInformation'); 25 | 26 | if (isset($input['photo'])) { 27 | $user->updateProfilePhoto($input['photo']); 28 | } 29 | 30 | if ($input['email'] !== $user->email && 31 | $user instanceof MustVerifyEmail) { 32 | $this->updateVerifiedUser($user, $input); 33 | } else { 34 | $user->forceFill([ 35 | 'name' => $input['name'], 36 | 'email' => $input['email'], 37 | ])->save(); 38 | } 39 | } 40 | 41 | /** 42 | * Update the given verified user's profile information. 43 | * 44 | * @param array $input 45 | */ 46 | protected function updateVerifiedUser(creator $user, array $input): void 47 | { 48 | $user->forceFill([ 49 | 'name' => $input['name'], 50 | 'email' => $input['email'], 51 | 'email_verified_at' => null, 52 | ])->save(); 53 | 54 | $user->sendEmailVerificationNotification(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /resources/views/update.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 10 | 11 | 12 | 13 |
14 |
15 | @method('PUT') 16 | @csrf 17 |
18 | 19 | 20 | @error('title') 21 |
{{ $message }}
22 | @enderror 23 |
24 |
25 | 26 | 27 | 28 | 29 | @error('description') 30 |
{{ $message }}
31 | @enderror 32 |
33 |
34 | 35 | 36 | @error('creator_id') 37 |
{{ $message }}
38 | @enderror 39 |
40 | 41 | 42 |
43 |
44 | 45 | -------------------------------------------------------------------------------- /resources/js/Components/ConfirmationModal.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 58 | -------------------------------------------------------------------------------- /resources/views/posts.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | Document 11 | 12 | 13 |
14 | 15 |
16 |
17 | 18 |
19 |

20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | @foreach($posts as $post) 30 | 31 | 32 | 33 | 34 | 35 | 50 | 51 | @endforeach 52 | 53 | 54 |
titleposted bycreated atActions
{{$post->title}}{{$post->creator->name}}{{$post->created_at}} 36 | 37 |
38 | 39 | 40 |
41 | 42 | 43 |
44 | @method('DELETE') 45 | @csrf() 46 | 47 |
48 | 49 |
55 | {{ $posts->links() }} 56 |
57 | sign-in with git hub 58 | 59 | -------------------------------------------------------------------------------- /resources/js/Pages/Auth/ForgotPassword.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 62 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | 24 | */ 25 | public function definition(): array 26 | { 27 | return [ 28 | 'name' => $this->faker->name(), 29 | 'email' => $this->faker->unique()->safeEmail(), 30 | 'email_verified_at' => now(), 31 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 32 | 'two_factor_secret' => null, 33 | 'two_factor_recovery_codes' => null, 34 | 'remember_token' => Str::random(10), 35 | 'profile_photo_path' => null, 36 | 'current_team_id' => null, 37 | ]; 38 | } 39 | 40 | /** 41 | * Indicate that the model's email address should be unverified. 42 | * 43 | * @return $this 44 | */ 45 | public function unverified(): static 46 | { 47 | return $this->state(function (array $attributes) { 48 | return [ 49 | 'email_verified_at' => null, 50 | ]; 51 | }); 52 | } 53 | 54 | /** 55 | * Indicate that the user should have a personal team. 56 | * 57 | * @return $this 58 | */ 59 | public function withPersonalTeam(): static 60 | { 61 | if (! Features::hasTeamFeatures()) { 62 | return $this->state([]); 63 | } 64 | 65 | return $this->has( 66 | Team::factory() 67 | ->state(function (array $attributes, User $user) { 68 | return ['name' => $user->name.'\'s Team', 'user_id' => $user->id, 'personal_team' => true]; 69 | }), 70 | 'ownedTeams' 71 | ); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /resources/js/Pages/Auth/ConfirmPassword.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 64 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "The Laravel Framework.", 5 | "keywords": ["framework", "laravel"], 6 | "license": "MIT", 7 | "require": { 8 | "php": "^8.1", 9 | "guzzlehttp/guzzle": "^7.2", 10 | "inertiajs/inertia-laravel": "^0.6.8", 11 | "laravel/framework": "^10.0", 12 | "laravel/jetstream": "^3.0", 13 | "laravel/sanctum": "^3.2", 14 | "laravel/socialite": "^5.6", 15 | "laravel/tinker": "^2.8", 16 | "tightenco/ziggy": "^1.0" 17 | }, 18 | "require-dev": { 19 | "fakerphp/faker": "^1.9.1", 20 | "laravel/pint": "^1.0", 21 | "laravel/sail": "^1.18", 22 | "mockery/mockery": "^1.4.4", 23 | "nunomaduro/collision": "^7.0", 24 | "phpunit/phpunit": "^10.0", 25 | "spatie/laravel-ignition": "^2.0" 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 | ] 53 | }, 54 | "extra": { 55 | "laravel": { 56 | "dont-discover": [] 57 | } 58 | }, 59 | "config": { 60 | "optimize-autoloader": true, 61 | "preferred-install": "dist", 62 | "sort-packages": true, 63 | "allow-plugins": { 64 | "pestphp/pest-plugin": true, 65 | "php-http/discovery": true 66 | } 67 | }, 68 | "minimum-stability": "stable", 69 | "prefer-stable": true 70 | } 71 | -------------------------------------------------------------------------------- /resources/js/Pages/Profile/Show.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 58 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', '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 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', 40 | 'port' => env('PUSHER_PORT', 443), 41 | 'scheme' => env('PUSHER_SCHEME', 'https'), 42 | 'encrypted' => true, 43 | 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https', 44 | ], 45 | 'client_options' => [ 46 | // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html 47 | ], 48 | ], 49 | 50 | 'ably' => [ 51 | 'driver' => 'ably', 52 | 'key' => env('ABLY_KEY'), 53 | ], 54 | 55 | 'redis' => [ 56 | 'driver' => 'redis', 57 | 'connection' => 'default', 58 | ], 59 | 60 | 'log' => [ 61 | 'driver' => 'log', 62 | ], 63 | 64 | 'null' => [ 65 | 'driver' => 'null', 66 | ], 67 | 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /resources/js/Components/Dropdown.vue: -------------------------------------------------------------------------------- 1 | 48 | 49 | 80 | -------------------------------------------------------------------------------- /app/Http/Controllers/post_controller.php: -------------------------------------------------------------------------------- 1 | simplePaginate(); 23 | return view('posts',['posts'=>$posts]); 24 | } 25 | 26 | public function getPostsInfo($id) 27 | { 28 | 29 | $posts=post::where('id',$id)->get(); 30 | return view('view',compact('posts')); 31 | } 32 | 33 | 34 | function destroy($id) 35 | { 36 | 37 | // $post=post::find($id); 38 | // //dd($post); 39 | // $post->delete(); 40 | post::where('id',$id)->delete(); 41 | return redirect()->route('get_posts'); 42 | } 43 | function update($id) 44 | { 45 | $post = post::find($id); 46 | return view('update', compact('post')); 47 | } 48 | function edit($id, Request $request) 49 | { 50 | 51 | $validated = $request->validate([ 52 | 'title' => 'required', 53 | 'description' => 'required', 54 | 'creator_id' => 'required', 55 | 56 | ]); 57 | $post = post::where('id',$id)->update($request->except(['_method', '_token'])); 58 | 59 | return redirect()->route('get_posts'); 60 | } 61 | 62 | function create() 63 | { 64 | return view('create'); 65 | } 66 | function store(Request $request) 67 | { 68 | $validated = $request->validate([ 69 | 'title' => 'required', 70 | 'description' => 'required', 71 | // 'creator_id' => 'required', 72 | 73 | ]); 74 | 75 | 76 | post::create(['title'=>$request->title,'description'=>$request->description,'creator_id'=>Auth::user()->id]); 77 | return redirect()->route('get_posts'); 78 | } 79 | 80 | function show_users(){ 81 | $creators=creator::get(); 82 | return view('users',compact('creators')); 83 | } 84 | 85 | function show_user_info($id){ 86 | $user=creator::find($id); 87 | // $user=$user[0]; 88 | // $post=post::where('creator_id',$id)->get(); 89 | // dd($user); 90 | return view('user_info',compact('user')); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | Route::has('login'), 31 | 'canRegister' => Route::has('register'), 32 | 'laravelVersion' => Application::VERSION, 33 | 'phpVersion' => PHP_VERSION, 34 | ]); 35 | }); 36 | 37 | Route::middleware([ 38 | 'auth:sanctum', 39 | config('jetstream.auth_session'), 40 | 'verified', 41 | ])->group(function () { 42 | Route::get('/dashboard', function () { 43 | return Inertia::render('Dashboard'); 44 | })->name('dashboard'); 45 | /////////////////////////////////////////////// 46 | Route::get('/auth/redirect', function () { 47 | return Socialite::driver('github')->redirect(); 48 | }); 49 | 50 | Route::get('/auth/callback', function () { 51 | $user = Socialite::driver('github')->user(); 52 | 53 | // $user->token 54 | }); 55 | 56 | 57 | 58 | 59 | //////////////////////////////////////////// 60 | Route::get('show',[post_controller::class, 'getPosts'] )->name('get_posts'); 61 | Route::get('showpostinfo/{id}',[post_controller::class, 'getPostsInfo'] )->name('show_post'); 62 | 63 | Route::get('show_user',[post_controller::class, 'show_users'] )->name('user.show'); 64 | Route::get('showuserinfo/{id}',[post_controller::class, 'show_user_info'])->name('user.showinfo'); 65 | 66 | Route::delete('delete/{id}', [post_controller::class, 'destroy'])->name('post.destroy'); 67 | 68 | 69 | Route::get('update/{id}', [post_controller::class, 'update'])->name('post.update'); 70 | 71 | Route::put('edit/{id}', [post_controller::class, 'edit'])->name('post.edit'); 72 | 73 | 74 | Route::get('create', [post_controller::class, 'create'])->name('post.create'); 75 | Route::post('store', [post_controller::class, 'store'])->name('post.store'); 76 | 77 | }); 78 | -------------------------------------------------------------------------------- /config/sanctum.php: -------------------------------------------------------------------------------- 1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf( 19 | '%s%s', 20 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1', 21 | Sanctum::currentApplicationUrlWithPort() 22 | ))), 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Sanctum Guards 27 | |-------------------------------------------------------------------------- 28 | | 29 | | This array contains the authentication guards that will be checked when 30 | | Sanctum is trying to authenticate a request. If none of these guards 31 | | are able to authenticate the request, Sanctum will use the bearer 32 | | token that's present on an incoming request for authentication. 33 | | 34 | */ 35 | 36 | 'guard' => ['web'], 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Expiration Minutes 41 | |-------------------------------------------------------------------------- 42 | | 43 | | This value controls the number of minutes until an issued token will be 44 | | considered expired. If this value is null, personal access tokens do 45 | | not expire. This won't tweak the lifetime of first-party sessions. 46 | | 47 | */ 48 | 49 | 'expiration' => null, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Sanctum Middleware 54 | |-------------------------------------------------------------------------- 55 | | 56 | | When authenticating your first-party SPA with Sanctum you may need to 57 | | customize some of the middleware Sanctum uses while processing the 58 | | request. You may change the middleware listed below as required. 59 | | 60 | */ 61 | 62 | 'middleware' => [ 63 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, 64 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /tests/Feature/TwoFactorAuthenticationSettingsTest.php: -------------------------------------------------------------------------------- 1 | markTestSkipped('Two factor authentication is not enabled.'); 18 | 19 | return; 20 | } 21 | 22 | $this->actingAs($user = User::factory()->create()); 23 | 24 | $this->withSession(['auth.password_confirmed_at' => time()]); 25 | 26 | $response = $this->post('/user/two-factor-authentication'); 27 | 28 | $this->assertNotNull($user->fresh()->two_factor_secret); 29 | $this->assertCount(8, $user->fresh()->recoveryCodes()); 30 | } 31 | 32 | public function test_recovery_codes_can_be_regenerated(): void 33 | { 34 | if (! Features::canManageTwoFactorAuthentication()) { 35 | $this->markTestSkipped('Two factor authentication is not enabled.'); 36 | 37 | return; 38 | } 39 | 40 | $this->actingAs($user = User::factory()->create()); 41 | 42 | $this->withSession(['auth.password_confirmed_at' => time()]); 43 | 44 | $this->post('/user/two-factor-authentication'); 45 | $this->post('/user/two-factor-recovery-codes'); 46 | 47 | $user = $user->fresh(); 48 | 49 | $this->post('/user/two-factor-recovery-codes'); 50 | 51 | $this->assertCount(8, $user->recoveryCodes()); 52 | $this->assertCount(8, array_diff($user->recoveryCodes(), $user->fresh()->recoveryCodes())); 53 | } 54 | 55 | public function test_two_factor_authentication_can_be_disabled(): void 56 | { 57 | if (! Features::canManageTwoFactorAuthentication()) { 58 | $this->markTestSkipped('Two factor authentication is not enabled.'); 59 | 60 | return; 61 | } 62 | 63 | $this->actingAs($user = User::factory()->create()); 64 | 65 | $this->withSession(['auth.password_confirmed_at' => time()]); 66 | 67 | $this->post('/user/two-factor-authentication'); 68 | 69 | $this->assertNotNull($user->fresh()->two_factor_secret); 70 | 71 | $this->delete('/user/two-factor-authentication'); 72 | 73 | $this->assertNull($user->fresh()->two_factor_secret); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /resources/js/Pages/Auth/VerifyEmail.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 63 | -------------------------------------------------------------------------------- /tests/Feature/EmailVerificationTest.php: -------------------------------------------------------------------------------- 1 | markTestSkipped('Email verification not enabled.'); 22 | 23 | return; 24 | } 25 | 26 | $user = User::factory()->withPersonalTeam()->unverified()->create(); 27 | 28 | $response = $this->actingAs($user)->get('/email/verify'); 29 | 30 | $response->assertStatus(200); 31 | } 32 | 33 | public function test_email_can_be_verified(): void 34 | { 35 | if (! Features::enabled(Features::emailVerification())) { 36 | $this->markTestSkipped('Email verification not enabled.'); 37 | 38 | return; 39 | } 40 | 41 | Event::fake(); 42 | 43 | $user = User::factory()->unverified()->create(); 44 | 45 | $verificationUrl = URL::temporarySignedRoute( 46 | 'verification.verify', 47 | now()->addMinutes(60), 48 | ['id' => $user->id, 'hash' => sha1($user->email)] 49 | ); 50 | 51 | $response = $this->actingAs($user)->get($verificationUrl); 52 | 53 | Event::assertDispatched(Verified::class); 54 | 55 | $this->assertTrue($user->fresh()->hasVerifiedEmail()); 56 | $response->assertRedirect(RouteServiceProvider::HOME.'?verified=1'); 57 | } 58 | 59 | public function test_email_can_not_verified_with_invalid_hash(): void 60 | { 61 | if (! Features::enabled(Features::emailVerification())) { 62 | $this->markTestSkipped('Email verification not enabled.'); 63 | 64 | return; 65 | } 66 | 67 | $user = User::factory()->unverified()->create(); 68 | 69 | $verificationUrl = URL::temporarySignedRoute( 70 | 'verification.verify', 71 | now()->addMinutes(60), 72 | ['id' => $user->id, 'hash' => sha1('wrong-email')] 73 | ); 74 | 75 | $this->actingAs($user)->get($verificationUrl); 76 | 77 | $this->assertFalse($user->fresh()->hasVerifiedEmail()); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DISK', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Filesystem Disks 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure as many filesystem "disks" as you wish, and you 24 | | may even configure multiple disks of the same driver. Defaults have 25 | | been set up for each driver as an example of the required values. 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 | -------------------------------------------------------------------------------- /config/jetstream.php: -------------------------------------------------------------------------------- 1 | 'inertia', 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Jetstream Route Middleware 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify which middleware Jetstream will assign to the routes 27 | | that it registers with the application. When necessary, you may modify 28 | | these middleware; however, this default value is usually sufficient. 29 | | 30 | */ 31 | 32 | 'middleware' => ['web'], 33 | 34 | 'auth_session' => AuthenticateSession::class, 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Jetstream Guard 39 | |-------------------------------------------------------------------------- 40 | | 41 | | Here you may specify the authentication guard Jetstream will use while 42 | | authenticating users. This value should correspond with one of your 43 | | guards that is already present in your "auth" configuration file. 44 | | 45 | */ 46 | 47 | 'guard' => 'sanctum', 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Features 52 | |-------------------------------------------------------------------------- 53 | | 54 | | Some of Jetstream's features are optional. You may disable the features 55 | | by removing them from this array. You're free to only remove some of 56 | | these features or you can even remove all of these if you need to. 57 | | 58 | */ 59 | 60 | 'features' => [ 61 | // Features::termsAndPrivacyPolicy(), 62 | // Features::profilePhotos(), 63 | // Features::api(), 64 | // Features::teams(['invitations' => true]), 65 | Features::accountDeletion(), 66 | ], 67 | 68 | /* 69 | |-------------------------------------------------------------------------- 70 | | Profile Photo Disk 71 | |-------------------------------------------------------------------------- 72 | | 73 | | This configuration value determines the default disk that will be used 74 | | when storing profile photos for your application's users. Typically 75 | | this will be the "public" disk but you may adjust this if needed. 76 | | 77 | */ 78 | 79 | 'profile_photo_disk' => 'public', 80 | 81 | ]; 82 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | protected $middleware = [ 17 | // \App\Http\Middleware\TrustHosts::class, 18 | \App\Http\Middleware\TrustProxies::class, 19 | \Illuminate\Http\Middleware\HandleCors::class, 20 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class, 21 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, 22 | \App\Http\Middleware\TrimStrings::class, 23 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, 24 | ]; 25 | 26 | /** 27 | * The application's route middleware groups. 28 | * 29 | * @var array> 30 | */ 31 | protected $middlewareGroups = [ 32 | 'web' => [ 33 | \App\Http\Middleware\EncryptCookies::class, 34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 35 | \Illuminate\Session\Middleware\StartSession::class, 36 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 37 | \App\Http\Middleware\VerifyCsrfToken::class, 38 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 39 | \App\Http\Middleware\HandleInertiaRequests::class, 40 | \Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class, 41 | ], 42 | 43 | 'api' => [ 44 | // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, 45 | \Illuminate\Routing\Middleware\ThrottleRequests::class.':api', 46 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 47 | ], 48 | ]; 49 | 50 | /** 51 | * The application's middleware aliases. 52 | * 53 | * Aliases may be used to conveniently assign middleware to routes and groups. 54 | * 55 | * @var array 56 | */ 57 | protected $middlewareAliases = [ 58 | 'auth' => \App\Http\Middleware\Authenticate::class, 59 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 60 | 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, 61 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 62 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 63 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 64 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 65 | 'signed' => \App\Http\Middleware\ValidateSignature::class, 66 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 67 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 68 | ]; 69 | } 70 | -------------------------------------------------------------------------------- /resources/js/Components/Banner.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 53 | -------------------------------------------------------------------------------- /resources/js/Pages/Auth/ResetPassword.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 86 | -------------------------------------------------------------------------------- /resources/js/Components/Modal.vue: -------------------------------------------------------------------------------- 1 | 58 | 59 | 92 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'sync'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection information for each server that 24 | | is used by your application. A default configuration has been added 25 | | for each back-end shipped with Laravel. You are 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 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | 'after_commit' => false, 43 | ], 44 | 45 | 'beanstalkd' => [ 46 | 'driver' => 'beanstalkd', 47 | 'host' => 'localhost', 48 | 'queue' => 'default', 49 | 'retry_after' => 90, 50 | 'block_for' => 0, 51 | 'after_commit' => false, 52 | ], 53 | 54 | 'sqs' => [ 55 | 'driver' => 'sqs', 56 | 'key' => env('AWS_ACCESS_KEY_ID'), 57 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 58 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 59 | 'queue' => env('SQS_QUEUE', 'default'), 60 | 'suffix' => env('SQS_SUFFIX'), 61 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 62 | 'after_commit' => false, 63 | ], 64 | 65 | 'redis' => [ 66 | 'driver' => 'redis', 67 | 'connection' => 'default', 68 | 'queue' => env('REDIS_QUEUE', 'default'), 69 | 'retry_after' => 90, 70 | 'block_for' => null, 71 | 'after_commit' => false, 72 | ], 73 | 74 | ], 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | Failed Queue Jobs 79 | |-------------------------------------------------------------------------- 80 | | 81 | | These options configure the behavior of failed queue job logging so you 82 | | can control which database and table are used to store the jobs that 83 | | have failed. You may change them to any database / table you wish. 84 | | 85 | */ 86 | 87 | 'failed' => [ 88 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 89 | 'database' => env('DB_CONNECTION', 'mysql'), 90 | 'table' => 'failed_jobs', 91 | ], 92 | 93 | ]; 94 | -------------------------------------------------------------------------------- /tests/Feature/PasswordResetTest.php: -------------------------------------------------------------------------------- 1 | markTestSkipped('Password updates are not enabled.'); 20 | 21 | return; 22 | } 23 | 24 | $response = $this->get('/forgot-password'); 25 | 26 | $response->assertStatus(200); 27 | } 28 | 29 | public function test_reset_password_link_can_be_requested(): void 30 | { 31 | if (! Features::enabled(Features::resetPasswords())) { 32 | $this->markTestSkipped('Password updates are not enabled.'); 33 | 34 | return; 35 | } 36 | 37 | Notification::fake(); 38 | 39 | $user = User::factory()->create(); 40 | 41 | $response = $this->post('/forgot-password', [ 42 | 'email' => $user->email, 43 | ]); 44 | 45 | Notification::assertSentTo($user, ResetPassword::class); 46 | } 47 | 48 | public function test_reset_password_screen_can_be_rendered(): void 49 | { 50 | if (! Features::enabled(Features::resetPasswords())) { 51 | $this->markTestSkipped('Password updates are not enabled.'); 52 | 53 | return; 54 | } 55 | 56 | Notification::fake(); 57 | 58 | $user = User::factory()->create(); 59 | 60 | $response = $this->post('/forgot-password', [ 61 | 'email' => $user->email, 62 | ]); 63 | 64 | Notification::assertSentTo($user, ResetPassword::class, function (object $notification) { 65 | $response = $this->get('/reset-password/'.$notification->token); 66 | 67 | $response->assertStatus(200); 68 | 69 | return true; 70 | }); 71 | } 72 | 73 | public function test_password_can_be_reset_with_valid_token(): void 74 | { 75 | if (! Features::enabled(Features::resetPasswords())) { 76 | $this->markTestSkipped('Password updates are not enabled.'); 77 | 78 | return; 79 | } 80 | 81 | Notification::fake(); 82 | 83 | $user = User::factory()->create(); 84 | 85 | $response = $this->post('/forgot-password', [ 86 | 'email' => $user->email, 87 | ]); 88 | 89 | Notification::assertSentTo($user, ResetPassword::class, function (object $notification) use ($user) { 90 | $response = $this->post('/reset-password', [ 91 | 'token' => $notification->token, 92 | 'email' => $user->email, 93 | 'password' => 'password', 94 | 'password_confirmation' => 'password', 95 | ]); 96 | 97 | $response->assertSessionHasNoErrors(); 98 | 99 | return true; 100 | }); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /resources/js/Components/ApplicationLogo.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /resources/js/Pages/Auth/Login.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 92 | -------------------------------------------------------------------------------- /resources/js/Components/ConfirmsPassword.vue: -------------------------------------------------------------------------------- 1 | 72 | 73 | 119 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 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", 30 | | "memcached", "redis", "dynamodb", "octane", "null" 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'apc' => [ 37 | 'driver' => 'apc', 38 | ], 39 | 40 | 'array' => [ 41 | 'driver' => 'array', 42 | 'serialize' => false, 43 | ], 44 | 45 | 'database' => [ 46 | 'driver' => 'database', 47 | 'table' => 'cache', 48 | 'connection' => null, 49 | 'lock_connection' => null, 50 | ], 51 | 52 | 'file' => [ 53 | 'driver' => 'file', 54 | 'path' => storage_path('framework/cache/data'), 55 | ], 56 | 57 | 'memcached' => [ 58 | 'driver' => 'memcached', 59 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 60 | 'sasl' => [ 61 | env('MEMCACHED_USERNAME'), 62 | env('MEMCACHED_PASSWORD'), 63 | ], 64 | 'options' => [ 65 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 66 | ], 67 | 'servers' => [ 68 | [ 69 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 70 | 'port' => env('MEMCACHED_PORT', 11211), 71 | 'weight' => 100, 72 | ], 73 | ], 74 | ], 75 | 76 | 'redis' => [ 77 | 'driver' => 'redis', 78 | 'connection' => 'cache', 79 | 'lock_connection' => 'default', 80 | ], 81 | 82 | 'dynamodb' => [ 83 | 'driver' => 'dynamodb', 84 | 'key' => env('AWS_ACCESS_KEY_ID'), 85 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 86 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 87 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 88 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 89 | ], 90 | 91 | 'octane' => [ 92 | 'driver' => 'octane', 93 | ], 94 | 95 | ], 96 | 97 | /* 98 | |-------------------------------------------------------------------------- 99 | | Cache Key Prefix 100 | |-------------------------------------------------------------------------- 101 | | 102 | | When utilizing the APC, database, memcached, Redis, or DynamoDB cache 103 | | stores there might be other applications using the same cache. For 104 | | that reason, you may prefix every cache key to avoid collisions. 105 | | 106 | */ 107 | 108 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), 109 | 110 | ]; 111 | -------------------------------------------------------------------------------- /resources/js/Pages/Auth/TwoFactorChallenge.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | 105 | -------------------------------------------------------------------------------- /resources/js/Pages/Profile/Partials/UpdatePasswordForm.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | 101 | -------------------------------------------------------------------------------- /resources/js/Pages/Profile/Partials/DeleteUserForm.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | 103 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Laravel Logo

2 | 3 |

4 | Build Status 5 | Total Downloads 6 | Latest Stable Version 7 | License 8 |

9 | 10 | ## About Laravel 11 | 12 | Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: 13 | 14 | - [Simple, fast routing engine](https://laravel.com/docs/routing). 15 | - [Powerful dependency injection container](https://laravel.com/docs/container). 16 | - Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. 17 | - Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). 18 | - Database agnostic [schema migrations](https://laravel.com/docs/migrations). 19 | - [Robust background job processing](https://laravel.com/docs/queues). 20 | - [Real-time event broadcasting](https://laravel.com/docs/broadcasting). 21 | 22 | Laravel is accessible, powerful, and provides tools required for large, robust applications. 23 | 24 | ## Learning Laravel 25 | 26 | Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. 27 | 28 | You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch. 29 | 30 | If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. 31 | 32 | ## Laravel Sponsors 33 | 34 | We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell). 35 | 36 | ### Premium Partners 37 | 38 | - **[Vehikl](https://vehikl.com/)** 39 | - **[Tighten Co.](https://tighten.co)** 40 | - **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** 41 | - **[64 Robots](https://64robots.com)** 42 | - **[Cubet Techno Labs](https://cubettech.com)** 43 | - **[Cyber-Duck](https://cyber-duck.co.uk)** 44 | - **[Many](https://www.many.co.uk)** 45 | - **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)** 46 | - **[DevSquad](https://devsquad.com)** 47 | - **[Curotec](https://www.curotec.com/services/technologies/laravel/)** 48 | - **[OP.GG](https://op.gg)** 49 | - **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)** 50 | - **[Lendio](https://lendio.com)** 51 | 52 | ## Contributing 53 | 54 | Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). 55 | 56 | ## Code of Conduct 57 | 58 | In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). 59 | 60 | ## Security Vulnerabilities 61 | 62 | If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. 63 | 64 | ## License 65 | 66 | The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). 67 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 21 | 22 | /* 23 | |-------------------------------------------------------------------------- 24 | | Deprecations Log Channel 25 | |-------------------------------------------------------------------------- 26 | | 27 | | This option controls the log channel that should be used to log warnings 28 | | regarding deprecated PHP and library features. This allows you to get 29 | | your application ready for upcoming major versions of dependencies. 30 | | 31 | */ 32 | 33 | 'deprecations' => [ 34 | 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), 35 | 'trace' => false, 36 | ], 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Log Channels 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Here you may configure the log channels for your application. Out of 44 | | the box, Laravel uses the Monolog PHP logging library. This gives 45 | | you a variety of powerful log handlers / formatters to utilize. 46 | | 47 | | Available Drivers: "single", "daily", "slack", "syslog", 48 | | "errorlog", "monolog", 49 | | "custom", "stack" 50 | | 51 | */ 52 | 53 | 'channels' => [ 54 | 'stack' => [ 55 | 'driver' => 'stack', 56 | 'channels' => ['single'], 57 | 'ignore_exceptions' => false, 58 | ], 59 | 60 | 'single' => [ 61 | 'driver' => 'single', 62 | 'path' => storage_path('logs/laravel.log'), 63 | 'level' => env('LOG_LEVEL', 'debug'), 64 | ], 65 | 66 | 'daily' => [ 67 | 'driver' => 'daily', 68 | 'path' => storage_path('logs/laravel.log'), 69 | 'level' => env('LOG_LEVEL', 'debug'), 70 | 'days' => 14, 71 | ], 72 | 73 | 'slack' => [ 74 | 'driver' => 'slack', 75 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 76 | 'username' => 'Laravel Log', 77 | 'emoji' => ':boom:', 78 | 'level' => env('LOG_LEVEL', 'critical'), 79 | ], 80 | 81 | 'papertrail' => [ 82 | 'driver' => 'monolog', 83 | 'level' => env('LOG_LEVEL', 'debug'), 84 | 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), 85 | 'handler_with' => [ 86 | 'host' => env('PAPERTRAIL_URL'), 87 | 'port' => env('PAPERTRAIL_PORT'), 88 | 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), 89 | ], 90 | ], 91 | 92 | 'stderr' => [ 93 | 'driver' => 'monolog', 94 | 'level' => env('LOG_LEVEL', 'debug'), 95 | 'handler' => StreamHandler::class, 96 | 'formatter' => env('LOG_STDERR_FORMATTER'), 97 | 'with' => [ 98 | 'stream' => 'php://stderr', 99 | ], 100 | ], 101 | 102 | 'syslog' => [ 103 | 'driver' => 'syslog', 104 | 'level' => env('LOG_LEVEL', 'debug'), 105 | ], 106 | 107 | 'errorlog' => [ 108 | 'driver' => 'errorlog', 109 | 'level' => env('LOG_LEVEL', 'debug'), 110 | ], 111 | 112 | 'null' => [ 113 | 'driver' => 'monolog', 114 | 'handler' => NullHandler::class, 115 | ], 116 | 117 | 'emergency' => [ 118 | 'path' => storage_path('logs/laravel.log'), 119 | ], 120 | ], 121 | 122 | ]; 123 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_MAILER', 'smtp'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Mailer Configurations 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure all of the mailers used by your application plus 24 | | their respective settings. Several examples have been configured for 25 | | you and you are free to add your own as your application requires. 26 | | 27 | | Laravel supports a variety of mail "transport" drivers to be used while 28 | | sending an e-mail. You will specify which one you are using for your 29 | | mailers below. You are free to add additional mailers as required. 30 | | 31 | | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2", 32 | | "postmark", "log", "array", "failover" 33 | | 34 | */ 35 | 36 | 'mailers' => [ 37 | 'smtp' => [ 38 | 'transport' => 'smtp', 39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 40 | 'port' => env('MAIL_PORT', 587), 41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 42 | 'username' => env('MAIL_USERNAME'), 43 | 'password' => env('MAIL_PASSWORD'), 44 | 'timeout' => null, 45 | 'local_domain' => env('MAIL_EHLO_DOMAIN'), 46 | ], 47 | 48 | 'ses' => [ 49 | 'transport' => 'ses', 50 | ], 51 | 52 | 'mailgun' => [ 53 | 'transport' => 'mailgun', 54 | // 'client' => [ 55 | // 'timeout' => 5, 56 | // ], 57 | ], 58 | 59 | 'postmark' => [ 60 | 'transport' => 'postmark', 61 | // 'client' => [ 62 | // 'timeout' => 5, 63 | // ], 64 | ], 65 | 66 | 'sendmail' => [ 67 | 'transport' => 'sendmail', 68 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), 69 | ], 70 | 71 | 'log' => [ 72 | 'transport' => 'log', 73 | 'channel' => env('MAIL_LOG_CHANNEL'), 74 | ], 75 | 76 | 'array' => [ 77 | 'transport' => 'array', 78 | ], 79 | 80 | 'failover' => [ 81 | 'transport' => 'failover', 82 | 'mailers' => [ 83 | 'smtp', 84 | 'log', 85 | ], 86 | ], 87 | ], 88 | 89 | /* 90 | |-------------------------------------------------------------------------- 91 | | Global "From" Address 92 | |-------------------------------------------------------------------------- 93 | | 94 | | You may wish for all e-mails sent by your application to be sent from 95 | | the same address. Here, you may specify a name and address that is 96 | | used globally for all e-mails that are sent by your application. 97 | | 98 | */ 99 | 100 | 'from' => [ 101 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 102 | 'name' => env('MAIL_FROM_NAME', 'Example'), 103 | ], 104 | 105 | /* 106 | |-------------------------------------------------------------------------- 107 | | Markdown Mail Settings 108 | |-------------------------------------------------------------------------- 109 | | 110 | | If you are using Markdown based email rendering, you may configure your 111 | | theme and component paths here, allowing you to customize the design 112 | | of the emails. Or, you may simply stick with the Laravel defaults! 113 | | 114 | */ 115 | 116 | 'markdown' => [ 117 | 'theme' => 'default', 118 | 119 | 'paths' => [ 120 | resource_path('views/vendor/mail'), 121 | ], 122 | ], 123 | 124 | ]; 125 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => 'creator', 19 | ], 20 | 21 | 22 | /* 23 | |-------------------------------------------------------------------------- 24 | | Authentication Guards 25 | |-------------------------------------------------------------------------- 26 | | 27 | | Next, you may define every authentication guard for your application. 28 | | Of course, a great default configuration has been defined for you 29 | | here which uses session storage and the Eloquent user provider. 30 | | 31 | | All authentication drivers have a user provider. This defines how the 32 | | users are actually retrieved out of your database or other storage 33 | | mechanisms used by this application to persist your user's data. 34 | | 35 | | Supported: "session" 36 | | 37 | */ 38 | 39 | 'guards' => [ 40 | 'web' => [ 41 | 'driver' => 'session', 42 | 'provider' => 'creator', 43 | ], 44 | 45 | ], 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | User Providers 50 | |-------------------------------------------------------------------------- 51 | | 52 | | All authentication drivers have a user provider. This defines how the 53 | | users are actually retrieved out of your database or other storage 54 | | mechanisms used by this application to persist your user's data. 55 | | 56 | | If you have multiple user tables or models you may configure multiple 57 | | sources which represent each model / table. These sources may then 58 | | be assigned to any extra authentication guards you have defined. 59 | | 60 | | Supported: "database", "eloquent" 61 | | 62 | */ 63 | 64 | 'providers' => [ 65 | 'users' => [ 66 | 'driver' => 'eloquent', 67 | 'model' => App\Models\User::class, 68 | ], 69 | 70 | 'creator' => [ 71 | 'driver' => 'eloquent', 72 | 'model' => App\Models\creator::class 73 | ], 74 | 75 | // 'users' => [ 76 | // 'driver' => 'database', 77 | // 'table' => 'users', 78 | // ], 79 | ], 80 | 81 | /* 82 | |-------------------------------------------------------------------------- 83 | | Resetting Passwords 84 | |-------------------------------------------------------------------------- 85 | | 86 | | You may specify multiple password reset configurations if you have more 87 | | than one user table or model in the application and you want to have 88 | | separate password reset settings based on the specific user types. 89 | | 90 | | The expire time is the number of minutes that each reset token will be 91 | | considered valid. This security feature keeps tokens short-lived so 92 | | they have less time to be guessed. You may change this as needed. 93 | | 94 | | The throttle setting is the number of seconds a user must wait before 95 | | generating more password reset tokens. This prevents the user from 96 | | quickly generating a very large amount of password reset tokens. 97 | | 98 | */ 99 | 100 | 'passwords' => [ 101 | 'users' => [ 102 | 'provider' => 'users', 103 | 'table' => 'password_reset_tokens', 104 | 'expire' => 60, 105 | 'throttle' => 60, 106 | ], 107 | 108 | 'creator' => [ 109 | 'provider' => 'creator', 110 | 'table' => 'password_resets', 111 | 'expire' => 60, 112 | ], 113 | ], 114 | 115 | /* 116 | |-------------------------------------------------------------------------- 117 | | Password Confirmation Timeout 118 | |-------------------------------------------------------------------------- 119 | | 120 | | Here you may define the amount of seconds before a password confirmation 121 | | times out and the user is prompted to re-enter their password via the 122 | | confirmation screen. By default, the timeout lasts for three hours. 123 | | 124 | */ 125 | 126 | 'password_timeout' => 10800, 127 | 128 | ]; 129 | -------------------------------------------------------------------------------- /resources/js/Pages/Auth/Register.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 113 | -------------------------------------------------------------------------------- /config/fortify.php: -------------------------------------------------------------------------------- 1 | 'web', 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Fortify Password Broker 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify which password broker Fortify can use when a user 27 | | is resetting their password. This configured value should match one 28 | | of your password brokers setup in your "auth" configuration file. 29 | | 30 | */ 31 | 32 | 'passwords' => 'users', 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | Username / Email 37 | |-------------------------------------------------------------------------- 38 | | 39 | | This value defines which model attribute should be considered as your 40 | | application's "username" field. Typically, this might be the email 41 | | address of the users but you are free to change this value here. 42 | | 43 | | Out of the box, Fortify expects forgot password and reset password 44 | | requests to have a field named 'email'. If the application uses 45 | | another name for the field you may define it below as needed. 46 | | 47 | */ 48 | 49 | 'username' => 'email', 50 | 51 | 'email' => 'email', 52 | 53 | /* 54 | |-------------------------------------------------------------------------- 55 | | Home Path 56 | |-------------------------------------------------------------------------- 57 | | 58 | | Here you may configure the path where users will get redirected during 59 | | authentication or password reset when the operations are successful 60 | | and the user is authenticated. You are free to change this value. 61 | | 62 | */ 63 | 64 | 'home' => RouteServiceProvider::HOME, 65 | 66 | /* 67 | |-------------------------------------------------------------------------- 68 | | Fortify Routes Prefix / Subdomain 69 | |-------------------------------------------------------------------------- 70 | | 71 | | Here you may specify which prefix Fortify will assign to all the routes 72 | | that it registers with the application. If necessary, you may change 73 | | subdomain under which all of the Fortify routes will be available. 74 | | 75 | */ 76 | 77 | 'prefix' => '', 78 | 79 | 'domain' => null, 80 | 81 | /* 82 | |-------------------------------------------------------------------------- 83 | | Fortify Routes Middleware 84 | |-------------------------------------------------------------------------- 85 | | 86 | | Here you may specify which middleware Fortify will assign to the routes 87 | | that it registers with the application. If necessary, you may change 88 | | these middleware but typically this provided default is preferred. 89 | | 90 | */ 91 | 92 | 'middleware' => ['web'], 93 | 94 | /* 95 | |-------------------------------------------------------------------------- 96 | | Rate Limiting 97 | |-------------------------------------------------------------------------- 98 | | 99 | | By default, Fortify will throttle logins to five requests per minute for 100 | | every email and IP address combination. However, if you would like to 101 | | specify a custom rate limiter to call then you may specify it here. 102 | | 103 | */ 104 | 105 | 'limiters' => [ 106 | 'login' => 'login', 107 | 'two-factor' => 'two-factor', 108 | ], 109 | 110 | /* 111 | |-------------------------------------------------------------------------- 112 | | Register View Routes 113 | |-------------------------------------------------------------------------- 114 | | 115 | | Here you may specify if the routes returning views should be disabled as 116 | | you may not need them when building your own application. This may be 117 | | especially true if you're writing a custom single-page application. 118 | | 119 | */ 120 | 121 | 'views' => true, 122 | 123 | /* 124 | |-------------------------------------------------------------------------- 125 | | Features 126 | |-------------------------------------------------------------------------- 127 | | 128 | | Some of the Fortify features are optional. You may disable the features 129 | | by removing them from this array. You're free to only remove some of 130 | | these features or you can even remove all of these if you need to. 131 | | 132 | */ 133 | 134 | 'features' => [ 135 | Features::registration(), 136 | Features::resetPasswords(), 137 | // Features::emailVerification(), 138 | Features::updateProfileInformation(), 139 | Features::updatePasswords(), 140 | Features::twoFactorAuthentication([ 141 | 'confirm' => true, 142 | 'confirmPassword' => true, 143 | // 'window' => 0, 144 | ]), 145 | ], 146 | 147 | ]; 148 | --------------------------------------------------------------------------------