1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Dyrynda\Database; |
4
|
|
|
|
5
|
|
|
use Doctrine\DBAL\Types\Types; |
6
|
|
|
use Doctrine\DBAL\Types\BinaryType; |
7
|
|
|
use Illuminate\Database\Connection; |
8
|
|
|
use Illuminate\Support\Facades\Schema; |
9
|
|
|
use Illuminate\Support\ServiceProvider; |
10
|
|
|
use Illuminate\Database\Schema\Blueprint; |
11
|
|
|
use Dyrynda\Database\Connection\MySqlConnection; |
12
|
|
|
use Dyrynda\Database\Connection\SQLiteConnection; |
13
|
|
|
use Dyrynda\Database\Connection\PostgresConnection; |
14
|
|
|
|
15
|
|
|
class LaravelEfficientUuidServiceProvider extends ServiceProvider |
16
|
|
|
{ |
17
|
|
|
/** |
18
|
|
|
* Bootstrap any application services. |
19
|
|
|
* |
20
|
|
|
* @return void |
21
|
|
|
*/ |
22
|
4 |
|
public function boot() |
23
|
|
|
{ |
24
|
4 |
|
Schema::registerCustomDoctrineType( |
25
|
4 |
|
BinaryType::class, |
26
|
4 |
|
'efficientuuid', |
27
|
4 |
|
Types::BINARY |
28
|
|
|
); |
29
|
4 |
|
} |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* Register any application services. |
33
|
|
|
* |
34
|
|
|
* @return void |
35
|
|
|
*/ |
36
|
4 |
|
public function register() |
37
|
|
|
{ |
38
|
|
|
Connection::resolverFor('mysql', function ($connection, $database, $prefix, $config) { |
39
|
|
|
return new MySqlConnection($connection, $database, $prefix, $config); |
40
|
4 |
|
}); |
41
|
|
|
|
42
|
|
|
Connection::resolverFor('postgres', function ($connection, $database, $prefix, $config) { |
43
|
|
|
return new PostgresConnection($connection, $database, $prefix, $config); |
44
|
4 |
|
}); |
45
|
|
|
|
46
|
|
|
Connection::resolverFor('sqlite', function ($connection, $database, $prefix, $config) { |
47
|
4 |
|
return new SQLiteConnection($connection, $database, $prefix, $config); |
48
|
4 |
|
}); |
49
|
|
|
|
50
|
|
|
Blueprint::macro('efficientUuid', function ($column) { |
51
|
4 |
|
return $this->addColumn('efficientUuid', $column); |
|
|
|
|
52
|
4 |
|
}); |
53
|
4 |
|
} |
54
|
|
|
} |
55
|
|
|
|
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.