Skip to content

Commit

Permalink
Merge pull request #1 from spatie/master
Browse files Browse the repository at this point in the history
Laravel 7 Support
  • Loading branch information
dennislindsey authored Jun 4, 2020
2 parents cdcb87d + a5b6952 commit b9354f2
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 69 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
custom: https://spatie.be/open-source/support-us
48 changes: 48 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: run-tests

on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [7.4]
laravel: [5.8.*, 6.*, 7.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 7.*
testbench: 5.*
- laravel: 6.*
testbench: 4.*
- laravel: 5.8.*
testbench: 3.8.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

27 changes: 11 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/laravel-missing-page-redirector.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-missing-page-redirector)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://img.shields.io/travis/spatie/laravel-missing-page-redirector/master.svg?style=flat-square)](https://travis-ci.org/spatie/laravel-missing-page-redirector)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/spatie/laravel-missing-page-redirector/run-tests?label=tests)
[![Quality Score](https://img.shields.io/scrutinizer/g/spatie/laravel-missing-page-redirector.svg?style=flat-square)](https://scrutinizer-ci.com/g/spatie/laravel-missing-page-redirector)
[![StyleCI](https://styleci.io/repos/70787365/shield?branch=master)](https://styleci.io/repos/70787365)
[![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-missing-page-redirector.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-missing-page-redirector)
Expand All @@ -11,6 +11,16 @@ When transitioning from a old site to a new one your URLs may change. If your ol

When installed you only need to [add your redirects to the config file](https://github.com/spatie/laravel-missing-page-redirector#usage). Want to use the database as your source of redirects? [No problem](https://github.com/spatie/laravel-missing-page-redirector#creating-your-own-redirector)!

## Support us

Learn how to create a package like this one, by watching our premium video course:

[![Laravel Package training](https://spatie.be/github/package-training.jpg)](https://laravelpackage.training)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

## Installation

You can install the package via composer:
Expand Down Expand Up @@ -154,26 +164,11 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

## Postcardware

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.

We publish all received postcards [on our company website](https://spatie.be/en/opensource/postcards).

## Credits

- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

## Support us

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).

Does your business depend on our contributions? Reach out and support us on [Patreon](https://www.patreon.com/spatie).
All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
],
"require": {
"php": "^7.2",
"laravel/framework": "~5.8.0|^6.0",
"laravel/framework": "~5.8.0|^6.0|^7.0",
"spatie/url": "^1.0"
},
"require-dev": {
"orchestra/testbench": "~3.8.0|^4.0",
"phpunit/phpunit": "^8.0"
"orchestra/testbench": "~3.8.0|^4.0|^5.0",
"phpunit/phpunit": "^8.0|^9.0"
},
"autoload": {
"psr-4": {
Expand All @@ -46,5 +46,7 @@
"Spatie\\MissingPageRedirector\\MissingPageRedirectorServiceProvider"
]
}
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
4 changes: 2 additions & 2 deletions config/missing-page-redirector.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* You can use Laravel's route parameters here.
*/
'redirects' => [
// '/non-existing-page' => '/existing-page',
// '/old-blog/{url}' => '/new-blog/{url}',
// '/non-existing-page' => '/existing-page',
// '/old-blog/{url}' => '/new-blog/{url}',
],

];
6 changes: 3 additions & 3 deletions src/MissingPageRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

use Exception;
use Illuminate\Routing\Router;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Spatie\MissingPageRedirector\Events\RedirectNotFound;
use Spatie\MissingPageRedirector\Events\RouteWasHit;
use Spatie\MissingPageRedirector\Redirector\Redirector;
use Spatie\MissingPageRedirector\Events\RedirectNotFound;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class MissingPageRouter
{
Expand Down
4 changes: 2 additions & 2 deletions tests/RedirectsMissingPagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Spatie\MissingPageRedirector\Test;

use Illuminate\Support\Facades\Event;
use Symfony\Component\HttpFoundation\Response;
use Spatie\MissingPageRedirector\Events\RouteWasHit;
use Spatie\MissingPageRedirector\Events\RedirectNotFound;
use Spatie\MissingPageRedirector\Events\RouteWasHit;
use Symfony\Component\HttpFoundation\Response;

class RedirectsMissingPagesTest extends TestCase
{
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Spatie\MissingPageRedirector\Test;

use Route;
use Illuminate\Contracts\Http\Kernel;
use PHPUnit\Framework\Assert as PHPUnit;
use Orchestra\Testbench\TestCase as Orchestra;
use Spatie\MissingPageRedirector\RedirectsMissingPages;
use PHPUnit\Framework\Assert as PHPUnit;
use Route;
use Spatie\MissingPageRedirector\MissingPageRedirectorServiceProvider;
use Spatie\MissingPageRedirector\RedirectsMissingPages;

abstract class TestCase extends Orchestra
{
Expand Down

0 comments on commit b9354f2

Please sign in to comment.