Skip to content

Commit 2264098

Browse files
committed
Initial v3 changes, change log to follow.
1 parent efee33d commit 2264098

File tree

925 files changed

+2860
-95228
lines changed

Some content is hidden

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

925 files changed

+2860
-95228
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
],
1212
"homepage": "https://github.com/dcblogdev/laravel-admintw",
1313
"require": {
14-
"php": "^8.0",
15-
"illuminate/filesystem": "^9.0|^10.0",
16-
"illuminate/support": "^9.0|^10.0"
14+
"php": "^8.1",
15+
"illuminate/filesystem": "^10.0",
16+
"illuminate/support": "^10.0"
1717
},
1818
"autoload": {
1919
"psr-4": {

src/Console/InstallCommand.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,23 @@ public function handle(): void
3030
{
3131
//copy folders
3232
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/app', base_path('app'));
33+
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/config', base_path('config'));
3334
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/database', base_path('database'));
34-
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/public', base_path('public'));
3535
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/resources', base_path('resources'));
3636
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/routes', base_path('routes'));
3737
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/stubs', base_path('stubs'));
3838
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/tests', base_path('tests'));
3939

40+
copy(__DIR__.'/../../stubs/.env.example', base_path('.env.example'));
4041
copy(__DIR__.'/../../stubs/composer.json', base_path('composer.json'));
41-
copy(__DIR__.'/../../stubs/phpunit.xml', base_path('phpunit.xml'));
4242
copy(__DIR__.'/../../stubs/package.json', base_path('package.json'));
43+
copy(__DIR__.'/../../stubs/phpunit.xml', base_path('phpunit.xml'));
44+
copy(__DIR__.'/../../stubs/pint.json', base_path('pint.json'));
4345
copy(__DIR__.'/../../stubs/postcss.config.js', base_path('postcss.config.js'));
4446
copy(__DIR__.'/../../stubs/tailwind.config.js', base_path('tailwind.config.js'));
4547
copy(__DIR__.'/../../stubs/vite.config.js', base_path('vite.config.js'));
4648

47-
if (file_exists(base_path('resources/views/welcome.blade.php'))) {
48-
unlink(base_path('resources/views/welcome.blade.php'));
49-
}
50-
51-
if (file_exists(base_path('resources/css/app.css'))) {
52-
unlink(base_path('resources/css/app.css'));
53-
}
49+
(new Filesystem)->deleteDirectory('resources/css');
5450

5551
$this->info('Admin theme installed successfully.');
5652
$this->info('Please run "composer update" then "npm install && npm run build" command to build your assets.');

stubs/.env.example

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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=base
15+
DB_USERNAME=root
16+
DB_PASSWORD=
17+
18+
BROADCAST_DRIVER=log
19+
CACHE_DRIVER=file
20+
FILESYSTEM_DISK=local
21+
QUEUE_CONNECTION=sync
22+
SESSION_DRIVER=file
23+
SESSION_LIFETIME=120
24+
25+
MEMCACHED_HOST=127.0.0.1
26+
27+
REDIS_HOST=127.0.0.1
28+
REDIS_PASSWORD=null
29+
REDIS_PORT=6379
30+
31+
MAIL_MAILER=smtp
32+
MAIL_HOST=127.0.0.1
33+
MAIL_PORT=2525
34+
MAIL_USERNAME="${APP_NAME}"
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}"
Lines changed: 47 additions & 0 deletions
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('dashboard'));
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+
}
Lines changed: 40 additions & 0 deletions
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('dashboard'));
39+
}
40+
}
Lines changed: 24 additions & 0 deletions
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('dashboard'));
18+
}
19+
20+
$request->user()->sendEmailVerificationNotification();
21+
22+
return back()->with('status', 'verification-link-sent');
23+
}
24+
}
Lines changed: 21 additions & 0 deletions
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('dashboard'))
19+
: view('auth.verify-email');
20+
}
21+
}

stubs/app/Http/Controllers/Auth/ForgotPasswordController.php

Lines changed: 0 additions & 75 deletions
This file was deleted.

stubs/app/Http/Controllers/Auth/JoinController.php

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,25 @@ public function update(Request $request, $id): Redirector|RedirectResponse
2929
$user = User::findOrFail($id);
3030

3131
$request->validate([
32-
'newPassword' => [
32+
'newPassword' => [
3333
'required',
3434
'string',
35-
Password::min(8)
36-
->mixedCase()
37-
->letters()
38-
->numbers()
39-
->uncompromised()
35+
Password::default(),
4036
],
41-
'confirmPassword' => 'required|same:newPassword'
37+
'confirmPassword' => 'required|same:newPassword',
4238
], [
43-
'newPassword.required' => 'New password is required',
39+
'newPassword.required' => 'New password is required',
4440
'newPassword.uncompromised' => 'The given new password has appeared in a data leak by https://haveibeenpwned.com please choose a different new password. ',
45-
'confirmPassword.required' => 'Confirm password is required',
46-
'confirmPassword.same' => 'Confirm password and new password must match',
41+
'confirmPassword.required' => 'Confirm password is required',
42+
'confirmPassword.same' => 'Confirm password and new password must match',
4743
]);
4844

49-
$user->name = $request->input('name');
50-
$user->password = Hash::make($request->input('newPassword'));
51-
$user->is_active = 1;
52-
$user->invite_token = null;
45+
$user->name = $request->input('name');
46+
$user->password = Hash::make($request->input('newPassword'));
47+
$user->is_active = 1;
48+
$user->invite_token = null;
5349
$user->last_logged_in_at = now();
54-
$user->joined_at = now();
50+
$user->joined_at = now();
5551
$user->save();
5652

5753
$isForced2Fa = Setting::where('key', 'is_forced_2fa')->value('value');
@@ -60,15 +56,15 @@ public function update(Request $request, $id): Redirector|RedirectResponse
6056
}
6157

6258
AuditTrail::create([
63-
'user_id' => $user->id,
59+
'user_id' => $user->id,
6460
'reference_id' => $user->id,
65-
'title' => "Joined completed",
66-
'section' => 'Auth',
67-
'type' => 'join'
61+
'title' => 'Joined completed',
62+
'section' => 'Auth',
63+
'type' => 'join',
6864
]);
6965

7066
auth()->loginUsingId($user->id, true);
7167

72-
return redirect('admin');
68+
return redirect(route('dashboard'));
7369
}
7470
}

0 commit comments

Comments
 (0)