Skip to content

Commit 52da921

Browse files
authored
Merge pull request #639 from maxdestors/fix/laravel12
Fix/laravel12
2 parents 7664de7 + 9c787d9 commit 52da921

File tree

10 files changed

+73
-40
lines changed

10 files changed

+73
-40
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ php artisan vendor:publish --tag=laravel-email-database-log-migration
389389
- Use Laravel HTML Facade with [Laravel Collective](https://laravelcollective.com/):
390390
391391
```
392-
{!! html()->link(route('social.redirect', ['provider' => 'twitch']), 'Twitch', array('class' => 'btn btn-lg btn-primary btn-block twitch')) !!}
392+
{!! html()->a(route('social.redirect', ['provider' => 'twitch']), 'Twitch', array('class' => 'btn btn-lg btn-primary btn-block twitch')) !!}
393393
```
394394
395395
### Other API keys

app/Http/Controllers/ProfilesController.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@
1010
use App\Models\User;
1111
use App\Notifications\SendGoodbyeEmail;
1212
use App\Traits\CaptureIpTrait;
13-
use File;
1413
use Illuminate\Database\Eloquent\ModelNotFoundException;
1514
use Illuminate\Http\Request;
15+
use Illuminate\Support\Facades\Auth;
16+
use Illuminate\Support\Facades\File;
1617
use Illuminate\Support\Facades\Hash;
17-
use Illuminate\Support\Facades\Session;
18-
use Image;
18+
use Illuminate\Support\Facades\Validator;
19+
use Intervention\Image\Facades\Image;
1920
use jeremykenedy\Uuid\Uuid;
20-
use Validator;
21-
use View;
2221

2322
class ProfilesController extends Controller
2423
{
@@ -143,7 +142,7 @@ public function update(UpdateUserProfile $request, $username)
143142
*/
144143
public function updateUserAccount(Request $request, $id)
145144
{
146-
$currentUser = \Auth::user();
145+
$currentUser = Auth::user();
147146
$user = User::findOrFail($id);
148147
$emailCheck = ($request->input('email') !== '') && ($request->input('email') !== $user->email);
149148
$ipAddress = new CaptureIpTrait();
@@ -203,7 +202,7 @@ public function updateUserAccount(Request $request, $id)
203202
*/
204203
public function updateUserPassword(UpdateUserPasswordRequest $request, $id)
205204
{
206-
$currentUser = \Auth::user();
205+
$currentUser = Auth::user();
207206
$user = User::findOrFail($id);
208207
$ipAddress = new CaptureIpTrait();
209208

@@ -226,7 +225,7 @@ public function updateUserPassword(UpdateUserPasswordRequest $request, $id)
226225
public function upload(Request $request)
227226
{
228227
if ($request->hasFile('file')) {
229-
$currentUser = \Auth::user();
228+
$currentUser = Auth::user();
230229
$avatar = $request->file('file');
231230
$filename = 'avatar.'.$avatar->getClientOriginalExtension();
232231
$save_path = storage_path().'/users/id/'.$currentUser->id.'/uploads/images/avatar/';
@@ -270,7 +269,7 @@ public function userProfileAvatar($id, $image)
270269
*/
271270
public function deleteUserAccount(DeleteUserAccount $request, $id)
272271
{
273-
$currentUser = \Auth::user();
272+
$currentUser = Auth::user();
274273
$user = User::findOrFail($id);
275274
$ipAddress = new CaptureIpTrait();
276275

@@ -310,7 +309,7 @@ public function deleteUserAccount(DeleteUserAccount $request, $id)
310309
/**
311310
* Send GoodBye Email Function via Notify.
312311
*
313-
* @param array $user
312+
* @param User $user
314313
* @param string $token
315314
* @return void
316315
*/

app/Http/Controllers/ThemesManagementController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use App\Models\Theme;
66
use App\Models\User;
77
use Illuminate\Http\Request;
8-
use Validator;
8+
use Illuminate\Support\Facades\Validator;
99

1010
class ThemesManagementController extends Controller
1111
{

app/Http/Controllers/UsersManagementController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
use App\Models\Role;
77
use App\Models\User;
88
use App\Traits\CaptureIpTrait;
9-
use Auth;
109
use Illuminate\Http\Request;
1110
use Illuminate\Http\Response;
11+
use Illuminate\Support\Facades\Auth;
1212
use Illuminate\Support\Facades\Hash;
13-
use Validator;
13+
use Illuminate\Support\Facades\Validator;
1414

1515
class UsersManagementController extends Controller
1616
{

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"jeremykenedy/laravel-email-database-log": "^12.0",
2121
"jeremykenedy/laravel-exception-notifier": "^4.1",
2222
"jeremykenedy/laravel-https": "^2.0",
23-
"jeremykenedy/laravel-logger": "^10.0",
23+
"jeremykenedy/laravel-logger": "^11.0",
2424
"jeremykenedy/laravel-phpinfo": "^1.3",
2525
"jeremykenedy/laravel-roles": "^11.5",
2626
"jeremykenedy/laravel2step": "^4.0",
@@ -101,6 +101,6 @@
101101
"pestphp/pest-plugin": true
102102
}
103103
},
104-
"minimum-stability": "dev",
104+
"minimum-stability": "stable",
105105
"prefer-stable": true
106106
}

config/app.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
use App\Providers\MacroServiceProvider;
55
use Creativeorange\Gravatar\Facades\Gravatar;
66
use Illuminate\Support\Facades\Facade;
7-
use Illuminate\Support\Facades\Input;
87
use Illuminate\Support\Facades\Redis;
98
use Intervention\Image\Facades\Image;
109
use jeremykenedy\Uuid\Uuid;
@@ -220,7 +219,6 @@
220219
'aliases' => Facade::defaultAliases()->merge([
221220
'Redis' => Redis::class,
222221
'Socialite' => Socialite::class,
223-
'Input' => Input::class,
224222
'Gravatar' => Gravatar::class,
225223
'Image' => Image::class,
226224
'Uuid' => Uuid::class,

resources/views/profiles/edit.blade.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
</div>
5656
</div>
5757
</div>
58-
{{ html()->model($user->profile) }}
58+
@php( html()->model($user->profile) )
5959
{{ html()->form('POST', route('profile.update', $user->name))
6060
->id('user_profile_form')
6161
->class('form-horizontal')
@@ -161,11 +161,11 @@
161161
</div>
162162
</div>
163163
{{ html()->form()->close() }}
164-
{{ html()->endModel() }}
164+
@php( html()->endModel() )
165165
</div>
166166

167167
<div class="tab-pane fade edit-settings-tab" role="tabpanel" aria-labelledby="edit-settings-tab">
168-
{{ html()->model($user) }}
168+
@php( html()->model($user) )
169169
{{ html()->form('POST', action([App\Http\Controllers\ProfilesController::class, 'updateUserAccount'], $user->id))
170170
->id('user_basics_form')
171171
->open() }}
@@ -265,7 +265,7 @@
265265
</div>
266266
</div>
267267
{{ html()->form()->close() }}
268-
{{ html()->endModel() }}
268+
@php( html()->endModel() )
269269
</div>
270270

271271
<div class="tab-pane fade edit-account-tab" role="tabpanel" aria-labelledby="edit-account-tab">
@@ -289,7 +289,7 @@
289289
{{ trans('profile.changePwTitle') }}
290290
</h3>
291291

292-
{{ html()->model($user) }}
292+
@php( html()->model($user) )
293293
{{ html()->form('POST', action([App\Http\Controllers\ProfilesController::class, 'updateUserPassword'], $user->id))
294294
->attribute('autocomplete', 'new-password')
295295
->open() }}
@@ -340,7 +340,7 @@
340340
</div>
341341
</div>
342342
{{ html()->form()->close() }}
343-
{{ html()->endModel() }}
343+
@php( html()->endModel() )
344344

345345
</div>
346346

@@ -357,7 +357,7 @@
357357
<div class="row">
358358
<div class="col-sm-6 offset-sm-3 margin-bottom-3 text-center">
359359

360-
{{ html()->model($user) }}
360+
@php( html()->model($user) )
361361
{{ html()->form('POST', action([App\Http\Controllers\ProfilesController::class, 'deleteUserAccount'], $user->id))
362362
->open() }}
363363

@@ -374,19 +374,19 @@
374374
</div>
375375

376376
{{ html()->button('<i class="fa fa-trash-o fa-fw" aria-hidden="true"></i>' . trans('profile.deleteAccountBtn'))
377-
->class('btn btn-block btn-danger')
378-
->id('delete_account_trigger')
379-
->disabled()
380-
->type('button')
381-
->attribute('data-toggle', 'modal')
382-
->attribute('data-submit', trans('profile.deleteAccountBtnConfirm'))
383-
->attribute('data-target', '#confirmForm')
384-
->attribute('data-modalClass', 'modal-danger')
385-
->attribute('data-title', trans('profile.deleteAccountConfirmTitle'))
386-
->attribute('data-message', trans('profile.deleteAccountConfirmMsg')) }}
377+
->class('btn btn-block btn-danger')
378+
->id('delete_account_trigger')
379+
->disabled()
380+
->type('button')
381+
->attribute('data-toggle', 'modal')
382+
->attribute('data-submit', trans('profile.deleteAccountBtnConfirm'))
383+
->attribute('data-target', '#confirmForm')
384+
->attribute('data-modalClass', 'modal-danger')
385+
->attribute('data-title', trans('profile.deleteAccountConfirmTitle'))
386+
->attribute('data-message', trans('profile.deleteAccountConfirmMsg')) }}
387387

388388
{{ html()->form()->close() }}
389-
{{ html()->endModel() }}
389+
@php( html()->endModel() )
390390

391391
</div>
392392
</div>

resources/views/profiles/show.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
{{ trans('profile.showProfileTwitterUsername') }}
101101
</dt>
102102
<dd>
103-
{!! html()->link('https://twitter.com/'.$user->profile->twitter_username, $user->profile->twitter_username, array('class' => 'twitter-link', 'target' => '_blank')) !!}
103+
{!! html()->a('https://twitter.com/'.$user->profile->twitter_username, $user->profile->twitter_username, array('class' => 'twitter-link', 'target' => '_blank')) !!}
104104
</dd>
105105
@endif
106106

@@ -109,7 +109,7 @@
109109
{{ trans('profile.showProfileGitHubUsername') }}
110110
</dt>
111111
<dd>
112-
{!! html()->link('https://github.com/'.$user->profile->github_username, $user->profile->github_username, array('class' => 'github-link', 'target' => '_blank')) !!}
112+
{!! html()->a('https://github.com/'.$user->profile->github_username, $user->profile->github_username, array('class' => 'github-link', 'target' => '_blank')) !!}
113113
</dd>
114114
@endif
115115
@endif

resources/views/scripts/form-modal-script.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script type="text/javascript">
2-
2+
$(function () {
33
var modalId = $('#confirmForm');
44
55
modalId.on('show.bs.modal', function (e) {
@@ -23,5 +23,5 @@
2323
modalId.find('.modal-footer #confirm').on('click', function(){
2424
$(this).data('form').submit();
2525
});
26-
26+
});
2727
</script>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@if ($paginator->hasPages())
2+
<ul class="pagination">
3+
{{-- Previous Page Link --}}
4+
@if ($paginator->onFirstPage())
5+
<li class="page-item disabled"><span class="page-link">&laquo;</span></li>
6+
@else
7+
<li class="page-item"><a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">&laquo;</a></li>
8+
@endif
9+
10+
{{-- Pagination Elements --}}
11+
@foreach ($elements as $element)
12+
{{-- "Three Dots" Separator --}}
13+
@if (is_string($element))
14+
<li class="page-item disabled"><span class="page-link">{{ $element }}</span></li>
15+
@endif
16+
17+
{{-- Array Of Links --}}
18+
@if (is_array($element))
19+
@foreach ($element as $page => $url)
20+
@if ($page == $paginator->currentPage())
21+
<li class="page-item active"><span class="page-link">{{ $page }}</span></li>
22+
@else
23+
<li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li>
24+
@endif
25+
@endforeach
26+
@endif
27+
@endforeach
28+
29+
{{-- Next Page Link --}}
30+
@if ($paginator->hasMorePages())
31+
<li class="page-item"><a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">&raquo;</a></li>
32+
@else
33+
<li class="page-item disabled"><span class="page-link">&raquo;</span></li>
34+
@endif
35+
</ul>
36+
@endif

0 commit comments

Comments
 (0)