Skip to content

Commit

Permalink
Updated package to laravel 5.1 package conventions. Now we publish mi…
Browse files Browse the repository at this point in the history
…grations instead of keeping them in the package directory structure.

Ready for Laravel 5.1 :D
  • Loading branch information
schneider-simon committed Jul 10, 2015
1 parent bb6b0d2 commit 62cde00
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,13 @@ Run a **composer update**.
);
```

### Step 3: Migrate tables
### Step 3: Publish migrations and config

```
$ php artisan migrate --package="triggerdesign/hermes"
php artisan vendor:publish
php artisan migrate
```

Now you have the 4 tables that we need for user conversations.

### Step 4: Use the user trait
Expand Down
7 changes: 5 additions & 2 deletions src/Triggerdesign/Hermes/HermesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@ public function boot()
});

$this->publishes([
__DIR__.'/../config/config.php' => config_path('hermes.php'),
__DIR__.'/../../config/config.php' => config_path('hermes.php'),
__DIR__.'/../../migrations/' => database_path('/migrations'),

]);


app()->bind('hermes::command.migration', function(){
return new \MigrationCommand();
});

$this->commands(['hermes::command.migration']);
//Use the published migration instead of a command (the documented Laravel 5.1 way)
//$this->commands(['hermes::command.migration']);

}

Expand Down
4 changes: 4 additions & 0 deletions src/commands/MigrationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ class MigrationCommand extends Command{
*/
protected $description = 'Migrate the necessary package migration files for hermes (messages, conversations, conversation_user, message_states).';

public function __construct(){
$this->app = app();
}

/**
* Run the package migrations
*/
Expand Down

0 comments on commit 62cde00

Please sign in to comment.