Arda
Arda

Reputation: 6926

Using Bundles in Laravel Migrations

I want to use sentry 1.x with Laravel 3.x in the migrations I use, but when I try to migrate I get this error:

PHP Fatal error: Class 'Sentry' not found in /var/www/laravel.dev/application/migrations/2013_03_06_183713_add_user_to_database.php on line 34

This is what I try to do in function up():

$user_id = Sentry::user()->create(array(
    'email' => '[email protected]',
    'password' => 'testpass',
    'metadata' => array(
    'first_name' => 'Test',
    'last_name' => 'Test'
    )
));

What am I missing ?

p.s: I know having the password in PHP is insecure, this is just a test environment.

Thanks,

Upvotes: 0

Views: 542

Answers (2)

Partoo
Partoo

Reputation: 11

Add 'Cartalyst\Sentry\SentryServiceProvider' to the list of service providers in app/config/app.php

Upvotes: 0

Collin James
Collin James

Reputation: 9280

You need to start the bundle.

Bundle::start( 'sentry' );

Upvotes: 3

Related Questions