Skip to content

Commit 3cd24da

Browse files
first commit
0 parents  commit 3cd24da

File tree

158 files changed

+19927
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+19927
-0
lines changed

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
2+
3+
<p align="center">
4+
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
5+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
6+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
7+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
8+
</p>
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 [[email protected]](mailto:[email protected]). 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).

app/Console/Kernel.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace App\Console;
4+
5+
use Illuminate\Console\Scheduling\Schedule;
6+
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
7+
8+
class Kernel extends ConsoleKernel
9+
{
10+
/**
11+
* Define the application's command schedule.
12+
*/
13+
protected function schedule(Schedule $schedule): void
14+
{
15+
// $schedule->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+
}

app/Exceptions/Handler.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace App\Exceptions;
4+
5+
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
6+
use Throwable;
7+
8+
class Handler extends ExceptionHandler
9+
{
10+
/**
11+
* The list of the inputs that are never flashed to the session on validation exceptions.
12+
*
13+
* @var array<int, string>
14+
*/
15+
protected $dontFlash = [
16+
'current_password',
17+
'password',
18+
'password_confirmation',
19+
];
20+
21+
/**
22+
* Register the exception handling callbacks for the application.
23+
*/
24+
public function register(): void
25+
{
26+
$this->reportable(function (Throwable $e) {
27+
//
28+
});
29+
}
30+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Http\Requests\Auth\LoginRequest;
7+
use App\Providers\RouteServiceProvider;
8+
use Illuminate\Http\RedirectResponse;
9+
use Illuminate\Http\Request;
10+
use Illuminate\Support\Facades\Auth;
11+
use Illuminate\Support\Facades\Route;
12+
use Inertia\Inertia;
13+
use Inertia\Response;
14+
15+
class AuthenticatedSessionController extends Controller
16+
{
17+
/**
18+
* Display the login view.
19+
*/
20+
public function create(): Response
21+
{
22+
return Inertia::render('Auth/Login', [
23+
'canResetPassword' => Route::has('password.request'),
24+
'status' => session('status'),
25+
]);
26+
}
27+
28+
/**
29+
* Handle an incoming authentication request.
30+
*/
31+
public function store(LoginRequest $request): RedirectResponse
32+
{
33+
$request->authenticate();
34+
35+
$request->session()->regenerate();
36+
37+
return redirect()->intended(RouteServiceProvider::HOME);
38+
}
39+
40+
/**
41+
* Destroy an authenticated session.
42+
*/
43+
public function destroy(Request $request): RedirectResponse
44+
{
45+
Auth::guard('web')->logout();
46+
47+
$request->session()->invalidate();
48+
49+
$request->session()->regenerateToken();
50+
51+
return redirect('/');
52+
}
53+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Providers\RouteServiceProvider;
7+
use Illuminate\Http\RedirectResponse;
8+
use Illuminate\Http\Request;
9+
use Illuminate\Support\Facades\Auth;
10+
use Illuminate\Validation\ValidationException;
11+
use Inertia\Inertia;
12+
use Inertia\Response;
13+
14+
class ConfirmablePasswordController extends Controller
15+
{
16+
/**
17+
* Show the confirm password view.
18+
*/
19+
public function show(): Response
20+
{
21+
return Inertia::render('Auth/ConfirmPassword');
22+
}
23+
24+
/**
25+
* Confirm the user's password.
26+
*/
27+
public function store(Request $request): RedirectResponse
28+
{
29+
if (! Auth::guard('web')->validate([
30+
'email' => $request->user()->email,
31+
'password' => $request->password,
32+
])) {
33+
throw ValidationException::withMessages([
34+
'password' => __('auth.password'),
35+
]);
36+
}
37+
38+
$request->session()->put('auth.password_confirmed_at', time());
39+
40+
return redirect()->intended(RouteServiceProvider::HOME);
41+
}
42+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Providers\RouteServiceProvider;
7+
use Illuminate\Http\RedirectResponse;
8+
use Illuminate\Http\Request;
9+
10+
class EmailVerificationNotificationController extends Controller
11+
{
12+
/**
13+
* Send a new email verification notification.
14+
*/
15+
public function store(Request $request): RedirectResponse
16+
{
17+
if ($request->user()->hasVerifiedEmail()) {
18+
return redirect()->intended(RouteServiceProvider::HOME);
19+
}
20+
21+
$request->user()->sendEmailVerificationNotification();
22+
23+
return back()->with('status', 'verification-link-sent');
24+
}
25+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Providers\RouteServiceProvider;
7+
use Illuminate\Http\RedirectResponse;
8+
use Illuminate\Http\Request;
9+
use Inertia\Inertia;
10+
use Inertia\Response;
11+
12+
class EmailVerificationPromptController extends Controller
13+
{
14+
/**
15+
* Display the email verification prompt.
16+
*/
17+
public function __invoke(Request $request): RedirectResponse|Response
18+
{
19+
return $request->user()->hasVerifiedEmail()
20+
? redirect()->intended(RouteServiceProvider::HOME)
21+
: Inertia::render('Auth/VerifyEmail', ['status' => session('status')]);
22+
}
23+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use Illuminate\Auth\Events\PasswordReset;
7+
use Illuminate\Http\RedirectResponse;
8+
use Illuminate\Http\Request;
9+
use Illuminate\Support\Facades\Hash;
10+
use Illuminate\Support\Facades\Password;
11+
use Illuminate\Support\Str;
12+
use Illuminate\Validation\Rules;
13+
use Illuminate\Validation\ValidationException;
14+
use Inertia\Inertia;
15+
use Inertia\Response;
16+
17+
class NewPasswordController extends Controller
18+
{
19+
/**
20+
* Display the password reset view.
21+
*/
22+
public function create(Request $request): Response
23+
{
24+
return Inertia::render('Auth/ResetPassword', [
25+
'email' => $request->email,
26+
'token' => $request->route('token'),
27+
]);
28+
}
29+
30+
/**
31+
* Handle an incoming new password request.
32+
*
33+
* @throws \Illuminate\Validation\ValidationException
34+
*/
35+
public function store(Request $request): RedirectResponse
36+
{
37+
$request->validate([
38+
'token' => 'required',
39+
'email' => 'required|email',
40+
'password' => ['required', 'confirmed', Rules\Password::defaults()],
41+
]);
42+
43+
// Here we will attempt to reset the user's password. If it is successful we
44+
// will update the password on an actual user model and persist it to the
45+
// database. Otherwise we will parse the error and return the response.
46+
$status = Password::reset(
47+
$request->only('email', 'password', 'password_confirmation', 'token'),
48+
function ($user) use ($request) {
49+
$user->forceFill([
50+
'password' => Hash::make($request->password),
51+
'remember_token' => Str::random(60),
52+
])->save();
53+
54+
event(new PasswordReset($user));
55+
}
56+
);
57+
58+
// If the password was successfully reset, we will redirect the user back to
59+
// the application's home authenticated view. If there is an error we can
60+
// redirect them back to where they came from with their error message.
61+
if ($status == Password::PASSWORD_RESET) {
62+
return redirect()->route('login')->with('status', __($status));
63+
}
64+
65+
throw ValidationException::withMessages([
66+
'email' => [trans($status)],
67+
]);
68+
}
69+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use Illuminate\Http\RedirectResponse;
7+
use Illuminate\Http\Request;
8+
use Illuminate\Support\Facades\Hash;
9+
use Illuminate\Validation\Rules\Password;
10+
11+
class PasswordController extends Controller
12+
{
13+
/**
14+
* Update the user's password.
15+
*/
16+
public function update(Request $request): RedirectResponse
17+
{
18+
$validated = $request->validate([
19+
'current_password' => ['required', 'current_password'],
20+
'password' => ['required', Password::defaults(), 'confirmed'],
21+
]);
22+
23+
$request->user()->update([
24+
'password' => Hash::make($validated['password']),
25+
]);
26+
27+
return back();
28+
}
29+
}

0 commit comments

Comments
 (0)