forked from etrepat/baum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.php
61 lines (48 loc) · 1.83 KB
/
bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our library. We just need to utilize it!
|
*/
require __DIR__.'/vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Initialize the Eloquent database manager
|--------------------------------------------------------------------------
|
| Eloquent can run as a stand-alone library (outside of Laravel applications)
| with all its functionality intact. We just need to bootstrap it correctly.
|
*/
use Illuminate\Container\Container;
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Events\Dispatcher;
$capsule = new Capsule;
$capsule->addConnection(require(__DIR__.'/tests/config/database.php'));
$capsule->setEventDispatcher(new Dispatcher(new Container));
$capsule->setAsGlobal();
$capsule->bootEloquent();
/*
|--------------------------------------------------------------------------
| Initialize the Collection extensions
|--------------------------------------------------------------------------
|
| This would normally be under a service provider on a laravel application but
| for testing we just initialize the mixin here.
|
*/
\Illuminate\Database\Eloquent\Collection::mixin(new \Baum\Mixins\Collection);
/*
|--------------------------------------------------------------------------
| Initialize the schema blueprint extensions
|--------------------------------------------------------------------------
|
| This would normally be under a service provider on a laravel application but
| for testing we just initialize the mixin here.
|
*/
\Illuminate\Database\Schema\Blueprint::mixin(new \Baum\Mixins\Blueprint);