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
|
|
|
|
14
|
|
|
class LaravelEfficientUuidServiceProvider extends ServiceProvider |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* Bootstrap any application services. |
18
|
|
|
* |
19
|
|
|
* @return void |
20
|
|
|
*/ |
21
|
3 |
|
public function boot() |
22
|
|
|
{ |
23
|
3 |
|
Schema::registerCustomDoctrineType( |
24
|
3 |
|
BinaryType::class, |
25
|
3 |
|
'efficientuuid', |
26
|
3 |
|
Types::BINARY |
27
|
|
|
); |
28
|
3 |
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* Register any application services. |
32
|
|
|
* |
33
|
|
|
* @return void |
34
|
|
|
*/ |
35
|
3 |
|
public function register() |
36
|
|
|
{ |
37
|
|
|
Connection::resolverFor('mysql', function ($connection, $database, $prefix, $config) { |
38
|
|
|
return new MySqlConnection($connection, $database, $prefix, $config); |
39
|
3 |
|
}); |
40
|
|
|
|
41
|
|
|
Connection::resolverFor('sqlite', function ($connection, $database, $prefix, $config) { |
42
|
3 |
|
return new SQLiteConnection($connection, $database, $prefix, $config); |
43
|
3 |
|
}); |
44
|
|
|
|
45
|
|
|
Blueprint::macro('efficientUuid', function ($column) { |
46
|
3 |
|
return $this->addColumn('efficientUuid', $column); |
|
|
|
|
47
|
3 |
|
}); |
48
|
3 |
|
} |
49
|
|
|
} |
50
|
|
|
|
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.