Completed
Push — master ( 0fdcfc...2205c9 )
by Mike
03:47
created

TranslatableServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 4
Bugs 2 Features 0
Metric Value
wmc 2
eloc 9
c 4
b 2
f 0
dl 0
loc 21
rs 10
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: mikeh
5
 * Date: 2018-05-28
6
 * Time: 8:27 AM.
7
 */
8
9
namespace Mikehins\Translatable;
10
11
use Illuminate\Support\Collection;
12
use Illuminate\Support\ServiceProvider;
13
14
class TranslatableServiceProvider extends ServiceProvider
15
{
16
<<<<<<< Updated upstream
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected T_SL, expecting T_FUNCTION or T_CONST on line 16 at column 0
Loading history...
17
    public function boot()
18
    {
19
        $this->loadMigrationsFrom(__DIR__.'/database/migrations/');
20
21
        $this->publishes([
22
            __DIR__.'/database/migrations/' => database_path('migrations'),
23
        ], 'migrations');
24
25
        $this->publishes([
26
            __DIR__.'/config/languages.php' => config_path('languages.php'),
27
        ]);
28
29
        Collection::macro('for', function ($field, $code) {
30
            return $this->where('key', $field)->where('locale', $code)->pluck('value')->first() ?? $field;
31
        });
32
    }
33
34
    public function register()
35
    {
36
    }
37
=======
38
	public function boot()
39
	{
40
		$this->loadMigrationsFrom(__DIR__ . '/database/migrations/');
41
		
42
		$this->publishes([
43
			__DIR__ . '/database/migrations/' => database_path('migrations')
44
		], 'migrations');
45
		
46
		$this->publishes([
47
			__DIR__ . '/config/languages.php' => config_path('languages.php'),
48
		], 'config');
49
		
50
		Collection::macro('for', function ($field, $code) {
51
			return $this->where('key', $field)->where('locale', $code)->pluck('value')->first() ?? $field;
52
		});
53
	}
54
	
55
	public function register()
56
	{
57
	}
58
>>>>>>> Stashed changes
59
}
60