Skip to content

Commit 4061669

Browse files
committed
starting ui
1 parent 746dec4 commit 4061669

File tree

110 files changed

+15225
-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.

110 files changed

+15225
-0
lines changed

.editorconfig

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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

.env.example

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
APP_NAME=Laravel
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
APP_TIMEZONE=UTC
6+
APP_URL=http://localhost
7+
8+
APP_LOCALE=en
9+
APP_FALLBACK_LOCALE=en
10+
APP_FAKER_LOCALE=en_US
11+
12+
APP_MAINTENANCE_DRIVER=file
13+
# APP_MAINTENANCE_STORE=database
14+
15+
BCRYPT_ROUNDS=12
16+
17+
LOG_CHANNEL=stack
18+
LOG_STACK=single
19+
LOG_DEPRECATIONS_CHANNEL=null
20+
LOG_LEVEL=debug
21+
22+
DB_CONNECTION=sqlite
23+
# DB_HOST=127.0.0.1
24+
# DB_PORT=3306
25+
# DB_DATABASE=laravel
26+
# DB_USERNAME=root
27+
# DB_PASSWORD=
28+
29+
SESSION_DRIVER=database
30+
SESSION_LIFETIME=120
31+
SESSION_ENCRYPT=false
32+
SESSION_PATH=/
33+
SESSION_DOMAIN=null
34+
35+
BROADCAST_CONNECTION=log
36+
FILESYSTEM_DISK=local
37+
QUEUE_CONNECTION=database
38+
39+
CACHE_STORE=database
40+
CACHE_PREFIX=
41+
42+
MEMCACHED_HOST=127.0.0.1
43+
44+
REDIS_CLIENT=phpredis
45+
REDIS_HOST=127.0.0.1
46+
REDIS_PASSWORD=null
47+
REDIS_PORT=6379
48+
49+
MAIL_MAILER=log
50+
MAIL_HOST=127.0.0.1
51+
MAIL_PORT=2525
52+
MAIL_USERNAME=null
53+
MAIL_PASSWORD=null
54+
MAIL_ENCRYPTION=null
55+
MAIL_FROM_ADDRESS="hello@example.com"
56+
MAIL_FROM_NAME="${APP_NAME}"
57+
58+
AWS_ACCESS_KEY_ID=
59+
AWS_SECRET_ACCESS_KEY=
60+
AWS_DEFAULT_REGION=us-east-1
61+
AWS_BUCKET=
62+
AWS_USE_PATH_STYLE_ENDPOINT=false
63+
64+
VITE_APP_NAME="${APP_NAME}"

.gitattributes

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
* text=auto eol=lf
2+
3+
*.blade.php diff=html
4+
*.css diff=css
5+
*.html diff=html
6+
*.md diff=markdown
7+
*.php diff=php
8+
9+
/.github export-ignore
10+
CHANGELOG.md export-ignore
11+
.styleci.yml export-ignore

.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/.phpunit.cache
2+
/node_modules
3+
/public/build
4+
/public/hot
5+
/public/storage
6+
/storage/*.key
7+
/vendor
8+
.env
9+
.env.backup
10+
.env.production
11+
.phpactor.json
12+
.phpunit.result.cache
13+
Homestead.json
14+
Homestead.yaml
15+
auth.json
16+
npm-debug.log
17+
yarn-error.log
18+
/.fleet
19+
/.idea
20+
/.vscode
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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 Illuminate\Http\RedirectResponse;
8+
use Illuminate\Http\Request;
9+
use Illuminate\Support\Facades\Auth;
10+
use Illuminate\View\View;
11+
12+
class AuthenticatedSessionController extends Controller
13+
{
14+
/**
15+
* Display the login view.
16+
*/
17+
public function create(): View
18+
{
19+
return view('auth.login');
20+
}
21+
22+
/**
23+
* Handle an incoming authentication request.
24+
*/
25+
public function store(LoginRequest $request): RedirectResponse
26+
{
27+
$request->authenticate();
28+
29+
$request->session()->regenerate();
30+
31+
return redirect()->intended(route('home', absolute: false));
32+
}
33+
34+
/**
35+
* Destroy an authenticated session.
36+
*/
37+
public function destroy(Request $request): RedirectResponse
38+
{
39+
Auth::guard('web')->logout();
40+
41+
$request->session()->invalidate();
42+
43+
$request->session()->regenerateToken();
44+
45+
return redirect('/');
46+
}
47+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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\Auth;
9+
use Illuminate\Validation\ValidationException;
10+
use Illuminate\View\View;
11+
12+
class ConfirmablePasswordController extends Controller
13+
{
14+
/**
15+
* Show the confirm password view.
16+
*/
17+
public function show(): View
18+
{
19+
return view('auth.confirm-password');
20+
}
21+
22+
/**
23+
* Confirm the user's password.
24+
*/
25+
public function store(Request $request): RedirectResponse
26+
{
27+
if (! Auth::guard('web')->validate([
28+
'email' => $request->user()->email,
29+
'password' => $request->password,
30+
])) {
31+
throw ValidationException::withMessages([
32+
'password' => __('auth.password'),
33+
]);
34+
}
35+
36+
$request->session()->put('auth.password_confirmed_at', time());
37+
38+
return redirect()->intended(route('home', absolute: false));
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
9+
class EmailVerificationNotificationController extends Controller
10+
{
11+
/**
12+
* Send a new email verification notification.
13+
*/
14+
public function store(Request $request): RedirectResponse
15+
{
16+
if ($request->user()->hasVerifiedEmail()) {
17+
return redirect()->intended(route('home', absolute: false));
18+
}
19+
20+
$request->user()->sendEmailVerificationNotification();
21+
22+
return back()->with('status', 'verification-link-sent');
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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\View\View;
9+
10+
class EmailVerificationPromptController extends Controller
11+
{
12+
/**
13+
* Display the email verification prompt.
14+
*/
15+
public function __invoke(Request $request): RedirectResponse|View
16+
{
17+
return $request->user()->hasVerifiedEmail()
18+
? redirect()->intended(route('home', absolute: false))
19+
: view('auth.verify-email');
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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\View\View;
14+
15+
class NewPasswordController extends Controller
16+
{
17+
/**
18+
* Display the password reset view.
19+
*/
20+
public function create(Request $request): View
21+
{
22+
return view('auth.reset-password', ['request' => $request]);
23+
}
24+
25+
/**
26+
* Handle an incoming new password request.
27+
*
28+
* @throws \Illuminate\Validation\ValidationException
29+
*/
30+
public function store(Request $request): RedirectResponse
31+
{
32+
$request->validate([
33+
'token' => ['required'],
34+
'email' => ['required', 'email'],
35+
'password' => ['required', 'confirmed', Rules\Password::defaults()],
36+
]);
37+
38+
// Here we will attempt to reset the user's password. If it is successful we
39+
// will update the password on an actual user model and persist it to the
40+
// database. Otherwise we will parse the error and return the response.
41+
$status = Password::reset(
42+
$request->only('email', 'password', 'password_confirmation', 'token'),
43+
function ($user) use ($request) {
44+
$user->forceFill([
45+
'password' => Hash::make($request->password),
46+
'remember_token' => Str::random(60),
47+
])->save();
48+
49+
event(new PasswordReset($user));
50+
}
51+
);
52+
53+
// If the password was successfully reset, we will redirect the user back to
54+
// the application's home authenticated view. If there is an error we can
55+
// redirect them back to where they came from with their error message.
56+
return $status == Password::PASSWORD_RESET
57+
? redirect()->route('login')->with('status', __($status))
58+
: back()->withInput($request->only('email'))
59+
->withErrors(['email' => __($status)]);
60+
}
61+
}
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->validateWithBag('updatePassword', [
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()->with('status', 'password-updated');
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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\Password;
9+
use Illuminate\View\View;
10+
11+
class PasswordResetLinkController extends Controller
12+
{
13+
/**
14+
* Display the password reset link request view.
15+
*/
16+
public function create(): View
17+
{
18+
return view('auth.forgot-password');
19+
}
20+
21+
/**
22+
* Handle an incoming password reset link request.
23+
*
24+
* @throws \Illuminate\Validation\ValidationException
25+
*/
26+
public function store(Request $request): RedirectResponse
27+
{
28+
$request->validate([
29+
'email' => ['required', 'email'],
30+
]);
31+
32+
// We will send the password reset link to this user. Once we have attempted
33+
// to send the link, we will examine the response then see the message we
34+
// need to show to the user. Finally, we'll send out a proper response.
35+
$status = Password::sendResetLink(
36+
$request->only('email')
37+
);
38+
39+
return $status == Password::RESET_LINK_SENT
40+
? back()->with('status', __($status))
41+
: back()->withInput($request->only('email'))
42+
->withErrors(['email' => __($status)]);
43+
}
44+
}

0 commit comments

Comments
 (0)