Skip to content

Commit bf6d63b

Browse files
authored
Merge pull request #630 from maxdestors/laravel12
Laravel 12
2 parents b33f1bb + 3ca83eb commit bf6d63b

File tree

156 files changed

+22409
-24571
lines changed

Some content is hidden

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

156 files changed

+22409
-24571
lines changed

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ APP_NAME=Laravel
22
APP_ENV=local
33
APP_KEY=
44
APP_DEBUG=true
5-
APP_URL=http://localhost
6-
APP_PROJECT_VERSION=10
5+
APP_URL=http://localhost:8000
6+
APP_PROJECT_VERSION=12
77

88
LOG_CHANNEL=stack
99

.env.travis

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ APP_ENV=local
33
APP_KEY=
44
APP_DEBUG=true
55
APP_URL=http://localhost
6-
APP_PROJECT_VERSION=5
6+
APP_PROJECT_VERSION=12
77

88
LOG_CHANNEL=stack
99

.eslintrc.js

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

.github/workflows/laravel.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
14+
- uses: shivammathur/setup-php@v2
1515
with:
16-
php-version: "8.1"
17-
- uses: actions/checkout@v3
16+
php-version: "8.3"
17+
- uses: actions/checkout@v5
1818
- name: Copy .env
1919
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
2020
- name: Install Dependencies

README.md

Lines changed: 214 additions & 165 deletions
Large diffs are not rendered by default.

app/Logic/Macros/HtmlMacros.php

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
use Collective\Html\HtmlFacade as HTML;
3+
use Illuminate\Support\Facades\Auth;
4+
use Illuminate\Support\Facades\URL;
5+
use Illuminate\Support\HtmlString;
46

57
/**
68
* Render an image with an anchor tag around it.
@@ -15,12 +17,20 @@
1517
*
1618
* @return string
1719
*/
18-
HTML::macro('image_link', function ($url = '', $img = '', $alt = '', $link_name = '', $param = '', $active = true, $ssl = false) {
19-
$url = $ssl === true ? URL::to_secure($url) : URL::to($url);
20-
$img = HTML::image($img, $alt);
21-
$img .= $link_name;
22-
$link = $active === true ? HTML::link($url, '#', $param) : $img;
23-
$link = str_replace('#', $img, $link);
20+
html()->macro('image_link', function ($url = '', $img = '', $alt = '', $link_name = '', $param = [], $active = true, $ssl = false) {
21+
$url = URL::to($url, [], $ssl === true);
22+
$imageHtml = (string) html()->img($img, $alt);
23+
$imageHtml .= $link_name;
24+
25+
if ($active !== true) {
26+
return new HtmlString($imageHtml);
27+
}
28+
29+
$link = html()->a($url)->html($imageHtml);
30+
31+
if (is_array($param) && ! empty($param)) {
32+
$link = $link->attributes($param);
33+
}
2434

2535
return $link;
2636
});
@@ -37,11 +47,19 @@
3747
*
3848
* @return string
3949
*/
40-
HTML::macro('icon_link', function ($url = '', $icon = '', $link_name = '', $param = '', $active = true, $ssl = false) {
41-
$url = $ssl === true ? URL::to_secure($url) : URL::to($url);
42-
$icon = '<i class="'.$icon.'" aria-hidden="true"></i>'.$link_name;
43-
$link = $active === true ? HTML::link($url, '#', $param) : $icon;
44-
$link = str_replace('#', $icon, $link);
50+
html()->macro('icon_link', function ($url = '', $icon = '', $link_name = '', $param = [], $active = true, $ssl = false) {
51+
$url = URL::to($url, [], $ssl === true);
52+
$iconHtml = '<i class="'.$icon.'" aria-hidden="true"></i>'.$link_name;
53+
54+
if ($active !== true) {
55+
return new HtmlString($iconHtml);
56+
}
57+
58+
$link = html()->a($url)->html($iconHtml);
59+
60+
if (is_array($param) && ! empty($param)) {
61+
$link = $link->attributes($param);
62+
}
4563

4664
return $link;
4765
});
@@ -58,11 +76,19 @@
5876
*
5977
* @return string
6078
*/
61-
HTML::macro('icon_btn', function ($url = '', $icon = '', $link_name = '', $param = '', $active = true, $ssl = false) {
62-
$url = $ssl === true ? URL::to_secure($url) : URL::to($url);
63-
$icon = $link_name.' <i class="'.$icon.'" aria-hidden="true"></i>';
64-
$link = $active === true ? HTML::link($url, '#', $param) : $icon;
65-
$link = str_replace('#', $icon, $link);
79+
html()->macro('icon_btn', function ($url = '', $icon = '', $link_name = '', $param = [], $active = true, $ssl = false) {
80+
$url = URL::to($url, [], $ssl === true);
81+
$iconHtml = $link_name.' <i class="'.$icon.'" aria-hidden="true"></i>';
82+
83+
if ($active !== true) {
84+
return new HtmlString($iconHtml);
85+
}
86+
87+
$link = html()->a($url)->html($iconHtml);
88+
89+
if (is_array($param) && ! empty($param)) {
90+
$link = $link->attributes($param);
91+
}
6692

6793
return $link;
6894
});
@@ -72,7 +98,7 @@
7298
*
7399
* @return string
74100
*/
75-
HTML::macro('show_username', function () {
101+
html()->macro('show_username', function () {
76102
$the_username = (Auth::user()->name === Auth::user()->email) ? ((is_null(Auth::user()->first_name)) ? (Auth::user()->name) : (Auth::user()->first_name)) : ((is_null(Auth::user()->name)) ? (Auth::user()->email) : (Auth::user()->name));
77103

78104
return $the_username;

app/Providers/AppServiceProvider.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Providers;
44

55
use Illuminate\Pagination\Paginator;
6+
use Illuminate\Support\Facades\Mail;
67
use Illuminate\Support\Facades\Schema;
78
use Illuminate\Support\Facades\URL;
89
use Illuminate\Support\ServiceProvider;
@@ -25,6 +26,12 @@ public function boot(): void
2526
if ($this->app->environment('production')) {
2627
URL::forceScheme('https');
2728
}
29+
30+
// Mock the email by using env MAIL_MOCK_TO
31+
if (env('MAIL_MOCK')) {
32+
Mail::alwaysTo(env('MAIL_MOCK_TO'));
33+
}
34+
2835
//Paginator::useBootstrapThree();
2936
Paginator::useBootstrap();
3037
Schema::defaultStringLength(191);

app/Providers/MacroServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace App\Providers;
44

55
use App\Logic\Macros\Macros;
6-
use Collective\Html\HtmlServiceProvider;
6+
use Spatie\Html\HtmlServiceProvider;
77

88
/**
99
* Class MacroServiceProvider.

composer.json

100755100644
Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,39 @@
1616
"google/recaptcha": "^1.3",
1717
"guzzlehttp/guzzle": "^7.2",
1818
"intervention/image": "^2.7",
19-
"jeremykenedy/laravel-blocker": "^4.0",
20-
"jeremykenedy/laravel-email-database-log": "^11.5",
21-
"jeremykenedy/laravel-exception-notifier": "^3.1",
19+
"jeremykenedy/laravel-blocker": "dev-laravel12",
20+
"jeremykenedy/laravel-email-database-log": "dev-fix/phpunit-gh-action",
21+
"jeremykenedy/laravel-exception-notifier": "^4.0",
2222
"jeremykenedy/laravel-https": "^2.0",
23-
"jeremykenedy/laravel-logger": "^7.1",
23+
"jeremykenedy/laravel-logger": "^10.0",
2424
"jeremykenedy/laravel-phpinfo": "^1.3",
25-
"jeremykenedy/laravel-roles": "^10.0",
26-
"jeremykenedy/laravel2step": "^3.0",
25+
"jeremykenedy/laravel-roles": "^11.5",
26+
"jeremykenedy/laravel2step": "dev-fix/laravel12",
2727
"jeremykenedy/uuid": "^3.1",
28-
"laravel/framework": "^10.0",
29-
"laravel/sanctum": "^3.2",
28+
"laravel/framework": "^12.0",
29+
"laravel/sanctum": "^4.2",
3030
"laravel/socialite": "^5.6",
3131
"laravel/tinker": "^2.8",
3232
"laravel/ui": "^4.2",
33-
"laravelcollective/html": "^6.4",
34-
"nesbot/carbon": "^2.66",
33+
"nesbot/carbon": "^3.8",
3534
"predis/predis": "^2.1",
3635
"pusher/pusher-php-server": "^7.2",
3736
"rap2hpoutre/laravel-log-viewer": "^2.3",
3837
"socialiteproviders/37signals": "^4.1",
3938
"socialiteproviders/instagram": "^5.0",
4039
"socialiteproviders/linkedin": "^4.2",
4140
"socialiteproviders/twitch": "^5.3",
42-
"socialiteproviders/youtube": "^4.1"
41+
"socialiteproviders/youtube": "^4.1",
42+
"spatie/laravel-html": "^3.12"
4343
},
4444
"require-dev": {
4545
"fakerphp/faker": "^1.9.1",
46-
"laravel/breeze": "^1.19",
46+
"laravel/breeze": "^2.3",
4747
"laravel/pint": "^1.0",
4848
"laravel/sail": "^1.18",
4949
"mockery/mockery": "^1.4.4",
50-
"nunomaduro/collision": "^7.0",
51-
"phpunit/phpunit": "^10.0",
50+
"nunomaduro/collision": "^8.8",
51+
"phpunit/phpunit": "^12.0",
5252
"spatie/laravel-ignition": "^2.0"
5353
},
5454
"autoload": {
@@ -101,6 +101,23 @@
101101
"pestphp/pest-plugin": true
102102
}
103103
},
104-
"minimum-stability": "stable",
105-
"prefer-stable": true
104+
"minimum-stability": "dev",
105+
"prefer-stable": true,
106+
"repositories": [
107+
{
108+
"type": "path",
109+
"url": "../laravel2step",
110+
"options": { "symlink": true }
111+
},
112+
{
113+
"type": "path",
114+
"url": "../laravel-email-database-log",
115+
"options": { "symlink": true }
116+
},
117+
{
118+
"type": "path",
119+
"url": "../laravel-blocker",
120+
"options": { "symlink": true }
121+
}
122+
]
106123
}

config/app.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
use App\Providers\ComposerServiceProvider;
44
use App\Providers\MacroServiceProvider;
5-
use Collective\Html\FormFacade;
6-
use Collective\Html\HtmlFacade;
75
use Creativeorange\Gravatar\Facades\Gravatar;
86
use Illuminate\Support\Facades\Facade;
97
use Illuminate\Support\Facades\Input;
@@ -64,7 +62,7 @@
6462
|
6563
*/
6664

67-
'url' => env('APP_URL', 'http://localhost'),
65+
'url' => env('APP_URL', 'http://localhost:8000'),
6866

6967
'asset_url' => env('ASSET_URL', '/'),
7068

@@ -221,8 +219,6 @@
221219

222220
'aliases' => Facade::defaultAliases()->merge([
223221
'Redis' => Redis::class,
224-
'Form' => FormFacade::class,
225-
'HTML' => HtmlFacade::class,
226222
'Socialite' => Socialite::class,
227223
'Input' => Input::class,
228224
'Gravatar' => Gravatar::class,

0 commit comments

Comments
 (0)