mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 01:34:03 +00:00
wip
This commit is contained in:
parent
d527191b89
commit
265216f7dc
4 changed files with 22 additions and 7 deletions
|
|
@ -1,5 +1,6 @@
|
|||
env:
|
||||
- DB_USERNAME=root DB_PASSWORD="" DB_DATABASE=travis_tenancy CODECOV_TOKEN="24382d15-84e7-4a55-bea4-c4df96a24a9b"
|
||||
- LARAVEL_VERSION="5.7.*" TESTBENCH_VERSION="~3.7"
|
||||
- LARAVEL_VERSION="5.8.*" TESTBENCH_VERSION="~3.8"
|
||||
|
||||
language: php
|
||||
php:
|
||||
|
|
@ -14,10 +15,13 @@ before_install:
|
|||
- echo "extension = redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||
|
||||
install:
|
||||
- composer require "laravel/framework:$LARAVEL_VERSION"
|
||||
- composer require "orchestra/testbench:$TESTBENCH_VERSION"
|
||||
- travis_retry composer install --no-interaction
|
||||
|
||||
before_script:
|
||||
- mysql -e 'CREATE DATABASE travis_tenancy;'
|
||||
- export DB_USERNAME=root DB_PASSWORD="" DB_DATABASE=travis_tenancy CODECOV_TOKEN="24382d15-84e7-4a55-bea4-c4df96a24a9b"
|
||||
|
||||
script: vendor/bin/phpunit -v --coverage-clover=coverage.xml
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Tenancy
|
||||
|
||||
[](https://laravel.com)
|
||||
[](https://laravel.com)
|
||||
[](https://packagist.org/packages/stancl/tenancy)
|
||||
[](https://travis-ci.com/stancl/tenancy)
|
||||
[](https://codecov.io/gh/stancl/tenancy)
|
||||
|
|
@ -25,6 +25,8 @@ composer require stancl/tenancy
|
|||
|
||||
This package follows [semantic versioning 2.0.0](https://semver.org). Each major release will have its own branch, so that bug fixes can be provided for older versions as well.
|
||||
|
||||
Both Laravel 5.7 and 5.8 is supported.
|
||||
|
||||
### Configuring the `InitializeTenancy` middleware
|
||||
|
||||
The `TenancyServiceProvider` automatically adds the `tenancy` middleware group which can be assigned to routes. You only need to make sure the middleware is top priority.
|
||||
|
|
|
|||
|
|
@ -10,14 +10,14 @@
|
|||
}
|
||||
],
|
||||
"require": {
|
||||
"illuminate/support": "5.8.*",
|
||||
"illuminate/support": "5.7.*||5.8.*",
|
||||
"webpatser/laravel-uuid": "^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"orchestra/testbench": "~3.8",
|
||||
"laravel/framework": "5.8.*",
|
||||
"vlucas/phpdotenv": "^3.3",
|
||||
"vlucas/phpdotenv": "^2.2||^3.3",
|
||||
"psy/psysh": "@stable",
|
||||
"laravel/framework": "5.7.*||5.8.*",
|
||||
"orchestra/testbench": "~3.7||~3.8",
|
||||
"league/flysystem-aws-s3-v3": "~1.0"
|
||||
},
|
||||
"autoload": {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
|
|||
protected function getEnvironmentSetUp($app)
|
||||
{
|
||||
if (file_exists(__DIR__ . '/../.env')) {
|
||||
\Dotenv\Dotenv::create(__DIR__ . '/..')->load();
|
||||
$this->loadDotEnv();
|
||||
}
|
||||
|
||||
$app['config']->set([
|
||||
|
|
@ -75,6 +75,15 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
|
|||
]);
|
||||
}
|
||||
|
||||
protected function loadDotEnv()
|
||||
{
|
||||
if (app()::VERSION > '5.8.0') {
|
||||
\Dotenv\Dotenv::create(__DIR__ . '/..')->load();
|
||||
} else {
|
||||
(new \Dotenv\Dotenv(__DIR__ . '/..'))->load();
|
||||
}
|
||||
}
|
||||
|
||||
protected function getPackageProviders($app)
|
||||
{
|
||||
return [\Stancl\Tenancy\TenancyServiceProvider::class];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue