|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Dyrynda\Database; |
|
4
|
|
|
|
|
5
|
|
|
use Illuminate\Database\Connection; |
|
6
|
|
|
use Illuminate\Support\ServiceProvider; |
|
7
|
|
|
use Illuminate\Database\Schema\Blueprint; |
|
8
|
|
|
use Dyrynda\Database\Connection\MySqlConnection; |
|
9
|
|
|
use Dyrynda\Database\Connection\SQLiteConnection; |
|
10
|
|
|
use Dyrynda\Database\Connection\PostgresConnection; |
|
11
|
|
|
|
|
12
|
|
|
class LaravelEfficientUuidServiceProvider extends ServiceProvider |
|
13
|
|
|
{ |
|
14
|
|
|
/** |
|
15
|
|
|
* Bootstrap any application services. |
|
16
|
|
|
* |
|
17
|
|
|
* @return void |
|
18
|
|
|
*/ |
|
19
|
3 |
|
public function boot() |
|
20
|
|
|
{ |
|
21
|
|
|
// |
|
22
|
3 |
|
} |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* Register any application services. |
|
26
|
|
|
* |
|
27
|
|
|
* @return void |
|
28
|
|
|
*/ |
|
29
|
3 |
|
public function register() |
|
30
|
|
|
{ |
|
31
|
|
|
Connection::resolverFor('mysql', function ($connection, $database, $prefix, $config) { |
|
32
|
|
|
return new MySqlConnection($connection, $database, $prefix, $config); |
|
33
|
3 |
|
}); |
|
34
|
|
|
|
|
35
|
|
|
Connection::resolverFor('postgres', function ($connection, $database, $prefix, $config) { |
|
36
|
|
|
return new PostgresConnection($connection, $database, $prefix, $config); |
|
37
|
3 |
|
}); |
|
38
|
|
|
|
|
39
|
|
|
Connection::resolverFor('sqlite', function ($connection, $database, $prefix, $config) { |
|
40
|
|
|
return new SQLiteConnection($connection, $database, $prefix, $config); |
|
41
|
3 |
|
}); |
|
42
|
|
|
|
|
43
|
|
|
Blueprint::macro('efficientUuid', function ($column) { |
|
44
|
3 |
|
return $this->addColumn('efficientUuid', $column); |
|
|
|
|
|
|
45
|
3 |
|
}); |
|
46
|
3 |
|
} |
|
47
|
|
|
} |
|
48
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.