Skip to content

Commit

Permalink
Require Laravel 10 for new installations
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalbaljet committed May 18, 2023
1 parent c10c4db commit fca5655
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.2, 8.1, 8.0]
laravel: [10.0, 9.3]
exclude:
- php: 8.0
laravel: 10.0
php: [8.2, 8.1]
laravel: [10.2]

name: Test Stubs P${{ matrix.php }} - L${{ matrix.laravel }}

Expand Down
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@
}
],
"require": {
"php": "^8.0.2",
"php": "^8.1",
"illuminate/console": "^9.37|^10.0",
"illuminate/filesystem": "^9.37|^10.0",
"illuminate/support": "^9.37|^10.0",
"illuminate/validation": "^9.37|^10.0",
"protonemedia/laravel-splade": "^1.3.0"
},
"conflict": {
"laravel/framework": "<9.37.0"
"protonemedia/laravel-splade": "^1.4.9"
},
"autoload": {
"psr-4": {
Expand Down
8 changes: 8 additions & 0 deletions src/Console/InstallsSpladeStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Filesystem\Filesystem;
use ProtoneMedia\Splade\Commands\InstallsSpladeExceptionHandler;
use ProtoneMedia\Splade\Commands\InstallsSpladeRouteMiddleware;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Finder\Finder;

trait InstallsSpladeStack
Expand All @@ -19,6 +20,13 @@ trait InstallsSpladeStack
*/
protected function installSpladeStack()
{
// Check Laravel version...
if (version_compare(app()->version(), '10.0', '<')) {
$this->error('While you can still use Splade with Laravel 9, new projects should use Laravel 10.');

return Command::FAILURE;
}

$this->installExceptionHandler();
$this->installRouteMiddleware();

Expand Down

0 comments on commit fca5655

Please sign in to comment.