forked from TiX-By/laravel-migrations-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 12e1c18
Showing
37 changed files
with
2,851 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# http://editorconfig.org/ | ||
|
||
root = true | ||
|
||
# Defaults - Linux style, 4 spaces | ||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
# Markdown uses trailing whitespace to indicate continuation lines | ||
[*.{markdown,md}] | ||
trim_trailing_whitespace = false | ||
|
||
# YAML | ||
[*.yml] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Exclude development files from exported zip files | ||
# To test this, commit the changes then run: | ||
# scripts/list-production-files.sh | ||
|
||
/.editorconfig export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
|
||
/*.md export-ignore | ||
/*.xml export-ignore | ||
|
||
/scripts export-ignore | ||
/tests export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# PHP packages | ||
/composer.lock | ||
/vendor | ||
|
||
# phpDocumentor | ||
/api-docs/ | ||
/phpdoc.xml | ||
|
||
# Test output | ||
/build/ | ||
/test-coverage/ | ||
/tests/storage/ | ||
|
||
# Operating system files | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Laravel Migrations UI | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace DaveJamesMiller\MigrationsUI; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
|
||
/** | ||
* The Laravel service provider, which registers, configures and bootstraps the package. | ||
*/ | ||
class MigrationsUIServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register(): void | ||
{ | ||
$this->mergeConfigFrom($this->path('config/migrations-ui.php'), 'migrations-ui'); | ||
} | ||
|
||
/** | ||
* Bootstrap the application events. | ||
* | ||
* @return void | ||
*/ | ||
public function boot(): void | ||
{ | ||
$this->loadRoutesFrom($this->path('routes.php')); | ||
|
||
$this->loadViewsFrom($this->path('views'), 'migrations-ui'); | ||
|
||
$this->publishes([ | ||
$this->path('config/migrations-ui.php') => config_path('migrations-ui.php'), | ||
], 'config'); | ||
} | ||
|
||
protected function path(string $path): string | ||
{ | ||
return dirname(__DIR__) . "/$path"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "davejamesmiller/laravel-migrations-ui", | ||
"description": "A web-based GUI for creating and running migrations in Laravel.", | ||
"keywords": [ | ||
"laravel" | ||
], | ||
"homepage": "https://github.com/davejamesmiller/laravel-migrations-ui", | ||
"authors": [ | ||
{ | ||
"name": "Dave James Miller", | ||
"email": "dave@davejamesmiller.com" | ||
} | ||
], | ||
"license": "MIT", | ||
"require": { | ||
"php": ">=7.1.3", | ||
"illuminate/support": "5.7.*", | ||
"illuminate/view": "5.7.*" | ||
}, | ||
"require-dev": { | ||
"laravel/framework": "5.7.*", | ||
"orchestra/testbench": "3.7.*", | ||
"phpunit/phpunit": "7.*", | ||
"php-coveralls/php-coveralls": "^1.0" | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"autoload": { | ||
"psr-4": { | ||
"DaveJamesMiller\\MigrationsUI\\": "classes/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"MigrationsUITests\\": "tests/" | ||
} | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"DaveJamesMiller\\MigrationsUI\\MigrationsUIServiceProvider" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Enabled? | ||
|-------------------------------------------------------------------------- | ||
| | ||
| By default this package is disabled in the production environment and | ||
| when debugging is disabled), because it allows users to run arbitrary | ||
| code. | ||
| | ||
*/ | ||
|
||
'enabled' => config('app.debug') && config('app.env') !== 'production', | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Path | ||
|-------------------------------------------------------------------------- | ||
| | ||
| You can change it if this conflicts with your own routes. | ||
| | ||
*/ | ||
|
||
'path' => '/migrations', | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Middleware | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Optionally add middleware to the package routes. | ||
| | ||
| e.g. to allow access to certain users only: | ||
| | ||
| 'middleware' => ['web', 'can:access-migrations-ui'] | ||
| | ||
*/ | ||
|
||
'middleware' => [], | ||
|
||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<phpdoc> | ||
<title>Laravel Migrations UI API Documentation</title> | ||
<parser> | ||
<target>api-docs/cache/parser/</target> | ||
</parser> | ||
<transformer> | ||
<target>api-docs/</target> | ||
</transformer> | ||
<files> | ||
<directory>src/</directory> | ||
</files> | ||
</phpdoc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutTestsThatDoNotTestAnything="true" | ||
bootstrap="vendor/autoload.php" | ||
beStrictAboutCoversAnnotation="true" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
verbose="true" | ||
> | ||
|
||
<!-- List of files with tests inside --> | ||
<testsuites> | ||
<testsuite name="Package Test Suite"> | ||
<directory suffix="Test.php">tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<!-- List of source files for code coverage checker --> | ||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">src/</directory> | ||
</whitelist> | ||
</filter> | ||
|
||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
$options = [ | ||
'middleware' => config('migrations-ui.middleware'), | ||
'namespace' => 'DaveJamesMiller\MigrationsUI\Controllers', | ||
'prefix' => config('migrations-ui.path'), | ||
]; | ||
|
||
Route::group($options, function () { | ||
|
||
Route::redirect('/', url('migrations/wireframes')); | ||
|
||
Route::prefix('wireframes')->group(function () { | ||
Route::view('/', 'migrations-ui::wireframes.index')->name('migrations-ui.wireframes.index'); | ||
Route::view('/create', 'migrations-ui::wireframes.create.step1')->name('migrations-ui.wireframes.create'); | ||
Route::view('/create/step2', 'migrations-ui::wireframes.create.step2')->name('migrations-ui.wireframes.create.step2'); | ||
Route::view('/create/step3', 'migrations-ui::wireframes.create.step3')->name('migrations-ui.wireframes.create.step3'); | ||
Route::view('/create/step4', 'migrations-ui::wireframes.create.step4')->name('migrations-ui.wireframes.create.step4'); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -o nounset -o pipefail -o errexit | ||
cd "$(dirname "$0")/.." | ||
|
||
################################################################################ | ||
# List files that will be included in a production install. | ||
# All files must be committed before running this script. | ||
################################################################################ | ||
|
||
git archive HEAD | tar -t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -o nounset -o pipefail -o errexit | ||
cd "$(dirname "$0")/.." | ||
|
||
################################################################################ | ||
# Run phpDocumentor. | ||
################################################################################ | ||
|
||
# Can't use Composer because there is a conflict between phpDocumentor and one | ||
# of the other Laravel Breadcrumbs dependencies | ||
[ -d api-docs/bin ] || mkdir -p api-docs/bin | ||
[ -f api-docs/bin/phpdoc ] || curl https://www.phpdoc.org/phpDocumentor.phar > api-docs/bin/phpdoc | ||
[ -x api-docs/bin/phpdoc ] || chmod +x api-docs/bin/phpdoc | ||
|
||
exec api-docs/bin/phpdoc "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
set -o nounset -o pipefail -o errexit | ||
cd "$(dirname "$0")/.." | ||
|
||
################################################################################ | ||
# Install the specified version of Laravel for testing. | ||
# | ||
# Usage: `t set-laravel-version <version>` | ||
# Example: `t set-laravel-version 5.7` | ||
# | ||
# This will update `project/composer.json` and install it. | ||
# *Do not commit the changes.* | ||
################################################################################ | ||
|
||
if [ $# -lt 1 ]; then | ||
echo "Usage: set-laravel-version <version>" | ||
exit 1 | ||
fi | ||
|
||
version="${1:-}" | ||
|
||
# Two separate steps because of: https://github.com/composer/composer/issues/7261 | ||
composer require --dev "laravel/framework:${version}.*" --no-update | ||
composer update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
set -o nounset -o pipefail -o errexit | ||
cd "$(dirname "$0")/.." | ||
|
||
################################################################################ | ||
# Run PHPUnit and generate code coverage report (requires Xdebug). | ||
################################################################################ | ||
|
||
if [ ! -d vendor ]; then | ||
composer install | ||
fi | ||
|
||
for executable in php7.2 php7.1; do | ||
if command -v $executable >/dev/null 2>&1; then | ||
exec $executable -d xdebug.coverage_enable=On vendor/bin/phpunit --coverage-html test-coverage/ "$@" | ||
fi | ||
done | ||
|
||
if ! $has_run; then | ||
exec php -d xdebug.coverage_enable=On vendor/bin/phpunit --coverage-html test-coverage/ "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
set -o nounset -o pipefail -o errexit | ||
cd "$(dirname "$0")/.." | ||
|
||
################################################################################ | ||
# Run PHPUnit. | ||
################################################################################ | ||
|
||
if [ ! -d vendor ]; then | ||
composer install | ||
fi | ||
|
||
has_run=false | ||
|
||
for executable in php7.2 php7.1; do | ||
if command -v $executable >/dev/null 2>&1; then | ||
$executable vendor/bin/phpunit "$@" | ||
has_run=true | ||
fi | ||
done | ||
|
||
if ! $has_run; then | ||
php vendor/bin/phpunit "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace MigrationsUITests; | ||
|
||
use DaveJamesMiller\MigrationsUI\MigrationsUIServiceProvider; | ||
use Orchestra\Testbench\TestCase as TestbenchTestCase; | ||
|
||
abstract class TestCase extends TestbenchTestCase | ||
{ | ||
protected function getPackageProviders($app) | ||
{ | ||
return [ | ||
MigrationsUIServiceProvider::class, | ||
]; | ||
} | ||
} |
Oops, something went wrong.