@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @return array |
34 | 34 | */ |
35 | - public function getFieldsSearchable() |
|
35 | + public function getFieldsSearchable () |
|
36 | 36 | { |
37 | 37 | return $this->fieldSearchable; |
38 | 38 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | /** |
41 | 41 | * Configure the Model. |
42 | 42 | **/ |
43 | - public function model() |
|
43 | + public function model () |
|
44 | 44 | { |
45 | 45 | return Type::class; |
46 | 46 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @return array |
42 | 42 | */ |
43 | - public function getFieldsSearchable() |
|
43 | + public function getFieldsSearchable () |
|
44 | 44 | { |
45 | 45 | return $this->fieldSearchable; |
46 | 46 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * Configure the Model. |
50 | 50 | **/ |
51 | - public function model() |
|
51 | + public function model () |
|
52 | 52 | { |
53 | 53 | return Address::class; |
54 | 54 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * |
95 | 95 | * @return void |
96 | 96 | */ |
97 | - public function __construct(array $attributes = []) |
|
97 | + public function __construct (array $attributes = []) |
|
98 | 98 | { |
99 | 99 | parent::__construct($attributes); |
100 | 100 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | /** |
105 | 105 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
106 | 106 | **/ |
107 | - public function country() |
|
107 | + public function country () |
|
108 | 108 | { |
109 | 109 | return $this->belongsTo(\App\Models\Pwweb\Localisation\Models\SystemLocalisationCountry::class, 'country_id'); |
110 | 110 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | /** |
113 | 113 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
114 | 114 | **/ |
115 | - public function type() |
|
115 | + public function type () |
|
116 | 116 | { |
117 | 117 | return $this->belongsTo(\App\Models\Pwweb\Localisation\Models\SystemAddressType::class, 'type_id'); |
118 | 118 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | /** |
121 | 121 | * @return \Illuminate\Database\Eloquent\Relations\HasOne |
122 | 122 | **/ |
123 | - public function systemModelHasAddress() |
|
123 | + public function systemModelHasAddress () |
|
124 | 124 | { |
125 | 125 | return $this->hasOne(\App\Models\Pwweb\Localisation\Models\SystemModelHasAddress::class); |
126 | 126 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * |
135 | 135 | * @return \PWWEB\Localisation\Contracts\Address |
136 | 136 | */ |
137 | - public static function findById(int $id): AddressContract |
|
137 | + public static function findById (int $id): AddressContract |
|
138 | 138 | { |
139 | 139 | $address = static::getAddresses(['id' => $id])->first(); |
140 | 140 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * |
155 | 155 | * @return \PWWEB\Localisation\Contracts\Address |
156 | 156 | */ |
157 | - public static function findByType(string $type): AddressContract |
|
157 | + public static function findByType (string $type): AddressContract |
|
158 | 158 | { |
159 | 159 | $address = static::getAddresses(['type' => $type])->first(); |
160 | 160 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * |
173 | 173 | * @return Collection collection of addresses |
174 | 174 | */ |
175 | - protected static function getAddresses(array $params = []): Collection |
|
175 | + protected static function getAddresses (array $params = []): Collection |
|
176 | 176 | { |
177 | 177 | return app(LocalisationRegistrar::class) |
178 | 178 | ->setAddressClass(static::class) |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | private $addressRepository; |
33 | 33 | |
34 | - public function __construct(AddressRepository $addressRepo, TypeRepository $typeRepo) |
|
34 | + public function __construct (AddressRepository $addressRepo, TypeRepository $typeRepo) |
|
35 | 35 | { |
36 | 36 | $this->addressRepository = $addressRepo; |
37 | 37 | $this->typeRepository = $typeRepo; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * |
45 | 45 | * @return Response |
46 | 46 | */ |
47 | - public function index(Request $request) |
|
47 | + public function index (Request $request) |
|
48 | 48 | { |
49 | 49 | $addresses = $this->addressRepository->all(); |
50 | 50 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @return Response |
59 | 59 | */ |
60 | - public function create() |
|
60 | + public function create () |
|
61 | 61 | { |
62 | 62 | $types = $this->typeRepository->all(); |
63 | 63 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * |
73 | 73 | * @return Response |
74 | 74 | */ |
75 | - public function store(CreateAddressRequest $request) |
|
75 | + public function store (CreateAddressRequest $request) |
|
76 | 76 | { |
77 | 77 | $input = $request->all(); |
78 | 78 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * |
91 | 91 | * @return Response |
92 | 92 | */ |
93 | - public function show($id) |
|
93 | + public function show ($id) |
|
94 | 94 | { |
95 | 95 | $address = $this->addressRepository->find($id); |
96 | 96 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * |
111 | 111 | * @return Response |
112 | 112 | */ |
113 | - public function edit($id) |
|
113 | + public function edit ($id) |
|
114 | 114 | { |
115 | 115 | $address = $this->addressRepository->find($id); |
116 | 116 | $types = $this->typeRepository->all(); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * |
136 | 136 | * @return Response |
137 | 137 | */ |
138 | - public function update($id, UpdateAddressRequest $request) |
|
138 | + public function update ($id, UpdateAddressRequest $request) |
|
139 | 139 | { |
140 | 140 | $address = $this->addressRepository->find($id); |
141 | 141 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | * |
162 | 162 | * @return Response |
163 | 163 | */ |
164 | - public function destroy($id) |
|
164 | + public function destroy ($id) |
|
165 | 165 | { |
166 | 166 | $address = $this->addressRepository->find($id); |
167 | 167 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @return bool |
27 | 27 | */ |
28 | - public function authorize() |
|
28 | + public function authorize () |
|
29 | 29 | { |
30 | 30 | return true; |
31 | 31 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * |
36 | 36 | * @return array |
37 | 37 | */ |
38 | - public function rules() |
|
38 | + public function rules () |
|
39 | 39 | { |
40 | 40 | return Address::$rules; |
41 | 41 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @return bool |
27 | 27 | */ |
28 | - public function authorize() |
|
28 | + public function authorize () |
|
29 | 29 | { |
30 | 30 | return true; |
31 | 31 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * |
36 | 36 | * @return array |
37 | 37 | */ |
38 | - public function rules() |
|
38 | + public function rules () |
|
39 | 39 | { |
40 | 40 | return Type::$rules; |
41 | 41 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @return bool |
27 | 27 | */ |
28 | - public function authorize() |
|
28 | + public function authorize () |
|
29 | 29 | { |
30 | 30 | return true; |
31 | 31 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * |
36 | 36 | * @return array |
37 | 37 | */ |
38 | - public function rules() |
|
38 | + public function rules () |
|
39 | 39 | { |
40 | 40 | return Address::$rules; |
41 | 41 | } |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @return void |
29 | 29 | */ |
30 | - public function register() |
|
30 | + public function register () |
|
31 | 31 | { |
32 | 32 | $this->mergeConfigFrom( |
33 | - __DIR__ . '/../config/localisation.php', |
|
33 | + __DIR__.'/../config/localisation.php', |
|
34 | 34 | 'pwweb.localisation' |
35 | 35 | ); |
36 | 36 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $this->app->make('PWWEB\Localisation\Controllers\IndexController'); |
39 | 39 | |
40 | 40 | // Register views. |
41 | - $this->loadViewsFrom(__DIR__ . '/resources/views', 'localisation'); |
|
41 | + $this->loadViewsFrom(__DIR__.'/resources/views', 'localisation'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -49,36 +49,36 @@ discard block |
||
49 | 49 | * |
50 | 50 | * @return void |
51 | 51 | */ |
52 | - public function boot(LocalisationRegistrar $localisationLoader, Filesystem $filesystem) |
|
52 | + public function boot (LocalisationRegistrar $localisationLoader, Filesystem $filesystem) |
|
53 | 53 | { |
54 | - include __DIR__ . '/../routes/web.php'; |
|
54 | + include __DIR__.'/../routes/web.php'; |
|
55 | 55 | |
56 | 56 | if (true === function_exists('config_path')) { |
57 | 57 | // function not available and 'publish' not relevant in Lumen |
58 | 58 | $this->publishes( |
59 | 59 | [ |
60 | - __DIR__ . '/../config/localisation.php' => config_path('pwweb/localisation.php'), |
|
60 | + __DIR__.'/../config/localisation.php' => config_path('pwweb/localisation.php'), |
|
61 | 61 | ], |
62 | 62 | 'pwweb.localisation.config' |
63 | 63 | ); |
64 | 64 | |
65 | 65 | $this->publishes( |
66 | 66 | [ |
67 | - __DIR__ . '/../database/migrations/create_localisation_tables.php.stub' => $this->getMigrationFileName($filesystem), |
|
67 | + __DIR__.'/../database/migrations/create_localisation_tables.php.stub' => $this->getMigrationFileName($filesystem), |
|
68 | 68 | ], |
69 | 69 | 'pwweb.localisation.migrations' |
70 | 70 | ); |
71 | 71 | |
72 | 72 | $this->publishes( |
73 | 73 | [ |
74 | - __DIR__ . '/resources/lang' => resource_path('lang/vendor/pwweb'), |
|
74 | + __DIR__.'/resources/lang' => resource_path('lang/vendor/pwweb'), |
|
75 | 75 | ], |
76 | 76 | 'pwweb.localisation.language' |
77 | 77 | ); |
78 | 78 | |
79 | 79 | $this->publishes( |
80 | 80 | [ |
81 | - __DIR__ . '/resources/views' => base_path('resources/views/vendor/localisation'), |
|
81 | + __DIR__.'/resources/views' => base_path('resources/views/vendor/localisation'), |
|
82 | 82 | ], |
83 | 83 | 'pwweb.localisation.views' |
84 | 84 | ); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | ] |
91 | 91 | ); |
92 | 92 | |
93 | - $this->loadTranslationsFrom(realpath(__DIR__ . '/resources/lang'), 'pwweb'); |
|
93 | + $this->loadTranslationsFrom(realpath(__DIR__.'/resources/lang'), 'pwweb'); |
|
94 | 94 | // dd(app()->getLocale()); |
95 | 95 | // echo '<pre>'; |
96 | 96 | // print_r($this->app['translator']); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | $this->app->singleton( |
108 | 108 | LocalisationRegistrar::class, |
109 | - function ($app) use ($localisationLoader) { |
|
109 | + function($app) use ($localisationLoader) { |
|
110 | 110 | return $localisationLoader; |
111 | 111 | } |
112 | 112 | ); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * |
121 | 121 | * @return void |
122 | 122 | */ |
123 | - protected function registerModelBindings() |
|
123 | + protected function registerModelBindings () |
|
124 | 124 | { |
125 | 125 | $config = $this->app->config['pwweb.localisation.models']; |
126 | 126 | |
@@ -136,16 +136,16 @@ discard block |
||
136 | 136 | * |
137 | 137 | * @return string migration filename |
138 | 138 | */ |
139 | - protected function getMigrationFileName(Filesystem $filesystem): string |
|
139 | + protected function getMigrationFileName (Filesystem $filesystem): string |
|
140 | 140 | { |
141 | 141 | $timestamp = date('Y_m_d_His', mktime(0, 0, 0, 1, 1, 2020)); |
142 | 142 | |
143 | - return Collection::make($this->app->databasePath() . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR) |
|
143 | + return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) |
|
144 | 144 | ->flatMap( |
145 | - function ($path) use ($filesystem) { |
|
146 | - return $filesystem->glob($path . '*_create_localisation_tables.php'); |
|
145 | + function($path) use ($filesystem) { |
|
146 | + return $filesystem->glob($path.'*_create_localisation_tables.php'); |
|
147 | 147 | } |
148 | - )->push($this->app->databasePath() . "/migrations/{$timestamp}_create_localisation_tables.php") |
|
148 | + )->push($this->app->databasePath()."/migrations/{$timestamp}_create_localisation_tables.php") |
|
149 | 149 | ->first(); |
150 | 150 | } |
151 | 151 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @param array $attributes additional attributes for model initialisation |
75 | 75 | */ |
76 | - public function __construct(array $attributes = []) |
|
76 | + public function __construct (array $attributes = []) |
|
77 | 77 | { |
78 | 78 | parent::__construct($attributes); |
79 | 79 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
87 | 87 | **/ |
88 | - public function addresses() |
|
88 | + public function addresses () |
|
89 | 89 | { |
90 | 90 | return $this->hasMany(\PWWEB\Localisation\Models\Address::class, 'type_id'); |
91 | 91 | } |
@@ -97,12 +97,12 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @return string |
99 | 99 | */ |
100 | - public function getNameAttribute($value) |
|
100 | + public function getNameAttribute ($value) |
|
101 | 101 | { |
102 | 102 | if (null === $value || '' === $value) { |
103 | 103 | return ''; |
104 | 104 | } |
105 | 105 | |
106 | - return __('pwweb::localisation.' . $value); |
|
106 | + return __('pwweb::localisation.'.$value); |
|
107 | 107 | } |
108 | 108 | } |