Skip to content

Commit

Permalink
Merge pull request #369 from nickurt/feature/laravel57
Browse files Browse the repository at this point in the history
Added support for Laravel 5.7+, and changed some small other things ...
  • Loading branch information
kaidesu authored Sep 5, 2018
2 parents 04ebb6b + 5632d6f commit 21b85f0
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 25 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: php

php:
- 7.0
- 7.1
- 7.2

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Caffeinated Modules
[![Latest Stable Version](https://poser.pugx.org/caffeinated/modules/v/stable?format=flat-square)](https://packagist.org/packages/caffeinated/modules)
[![Laravel 5.6](https://img.shields.io/badge/Laravel-5.6-orange.svg?style=flat-square)](https://laravel.com)
[![Laravel 5.7](https://img.shields.io/badge/Laravel-5.7-orange.svg?style=flat-square)](https://laravel.com)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://tldrlegal.com/license/mit-license)
[![Source](http://img.shields.io/badge/source-caffeinated/modules-blue.svg?style=flat-square)](https://github.com/caffeinated/modules)
[![Total Downloads](https://img.shields.io/packagist/dt/caffeinated/modules.svg?style=flat-square)](https://packagist.org/packages/caffeinated/modules)

Caffeinated Modules is a simple package to allow the means to separate your Laravel 5.6 application out into modules. Each module is completely self-contained allowing the ability to simply drop a module in for use.
Caffeinated Modules is a simple package to allow the means to separate your Laravel 5.7+ application out into modules. Each module is completely self-contained allowing the ability to simply drop a module in for use.

The package follows the FIG standards PSR-1, PSR-2, and PSR-4 to ensure a high level of interoperability between shared PHP code.

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
}
],
"require": {
"php": ">=7.0.0",
"illuminate/support": "^5.5,<5.7"
"php": "^7.1.3",
"illuminate/support": "5.7.x"
},
"require-dev": {
"mockery/mockery": "^1.0",
Expand Down
11 changes: 1 addition & 10 deletions src/Console/Commands/ModuleMigrateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,10 @@ protected function migrate($slug)
$step = Arr::get($this->option(), 'step', false);
$path = $this->getMigrationPath($slug);

$this->migrator->run($path, ['pretend' => $pretend, 'step' => $step]);
$this->migrator->setOutput($this->output)->run($path, ['pretend' => $pretend, 'step' => $step]);

event($slug.'.module.migrated', [$module, $this->option()]);

// Once the migrator has run we will grab the note output and send it out to
// the console screen, since the migrator itself functions without having
// any instances of the OutputInterface contract passed into the class.
foreach ($this->migrator->getNotes() as $note) {
if (!$this->option('quiet')) {
$this->line($note);
}
}

// Finally, if the "seed" option has been given, we will re-run the database
// seed task to re-populate the database, which is convenient when adding
// a migration and a seed at the same time, as it is only this command.
Expand Down
6 changes: 1 addition & 5 deletions src/Console/Commands/ModuleMigrateResetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected function reset()
{
$this->migrator->setconnection($this->input->getOption('database'));

$files = $this->migrator->getMigrationFiles($this->getMigrationPaths());
$files = $this->migrator->setOutput($this->output)->getMigrationFiles($this->getMigrationPaths());

$migrations = array_reverse($this->migrator->getRepository()->getRan());

Expand All @@ -105,10 +105,6 @@ protected function reset()
$this->runDown($files[$migration], (object) ["migration" => $migration]);
}
}

foreach ($this->migrator->getNotes() as $note) {
$this->output->writeln($note);
}
}

/**
Expand Down
6 changes: 1 addition & 5 deletions src/Console/Commands/ModuleMigrateRollbackCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,9 @@ public function handle()
$this->migrator->setConnection($this->option('database'));

$paths = $this->getMigrationPaths();
$this->migrator->rollback(
$this->migrator->setOutput($this->output)->rollback(
$paths, ['pretend' => $this->option('pretend'), 'step' => (int) $this->option('step')]
);

foreach ($this->migrator->getNotes() as $note) {
$this->output->writeln($note);
}
}

/**
Expand Down

0 comments on commit 21b85f0

Please sign in to comment.