@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | class ApiConsumer extends Facade |
6 | 6 | { |
7 | - protected static function getFacadeAccessor() |
|
8 | - { |
|
9 | - return 'ApiConsumer'; |
|
10 | - } |
|
7 | + protected static function getFacadeAccessor() |
|
8 | + { |
|
9 | + return 'ApiConsumer'; |
|
10 | + } |
|
11 | 11 | } |
@@ -2,17 +2,17 @@ |
||
2 | 2 | |
3 | 3 | class CoreConfig |
4 | 4 | { |
5 | - public function getConfig() |
|
6 | - { |
|
7 | - return [ |
|
8 | - /** |
|
9 | - * Specify what relations should be used for every model. |
|
10 | - */ |
|
11 | - 'relations' => config('skeleton.relations'), |
|
12 | - /** |
|
13 | - * Specify caching config for each api. |
|
14 | - */ |
|
15 | - 'cacheConfig' => config('skeleton.cache_config'), |
|
16 | - ]; |
|
17 | - } |
|
5 | + public function getConfig() |
|
6 | + { |
|
7 | + return [ |
|
8 | + /** |
|
9 | + * Specify what relations should be used for every model. |
|
10 | + */ |
|
11 | + 'relations' => config('skeleton.relations'), |
|
12 | + /** |
|
13 | + * Specify caching config for each api. |
|
14 | + */ |
|
15 | + 'cacheConfig' => config('skeleton.cache_config'), |
|
16 | + ]; |
|
17 | + } |
|
18 | 18 | } |
@@ -2,62 +2,62 @@ |
||
2 | 2 | |
3 | 3 | class Media |
4 | 4 | { |
5 | - /** |
|
6 | - * Upload the given image. |
|
7 | - * |
|
8 | - * @param object $image |
|
9 | - * @param string $dir |
|
10 | - * @return string |
|
11 | - */ |
|
12 | - public function uploadImage($image, $dir) |
|
13 | - { |
|
14 | - $image = \Image::make($image); |
|
15 | - return $this->saveImage($image, $dir); |
|
16 | - } |
|
5 | + /** |
|
6 | + * Upload the given image. |
|
7 | + * |
|
8 | + * @param object $image |
|
9 | + * @param string $dir |
|
10 | + * @return string |
|
11 | + */ |
|
12 | + public function uploadImage($image, $dir) |
|
13 | + { |
|
14 | + $image = \Image::make($image); |
|
15 | + return $this->saveImage($image, $dir); |
|
16 | + } |
|
17 | 17 | |
18 | - /** |
|
19 | - * Upload the given image. |
|
20 | - * |
|
21 | - * @param object $image |
|
22 | - * @param string $dir |
|
23 | - * @return string |
|
24 | - */ |
|
25 | - public function uploadImageBas64($image, $dir) |
|
26 | - { |
|
27 | - if (! strlen($image)) { |
|
28 | - return null; |
|
29 | - } |
|
18 | + /** |
|
19 | + * Upload the given image. |
|
20 | + * |
|
21 | + * @param object $image |
|
22 | + * @param string $dir |
|
23 | + * @return string |
|
24 | + */ |
|
25 | + public function uploadImageBas64($image, $dir) |
|
26 | + { |
|
27 | + if (! strlen($image)) { |
|
28 | + return null; |
|
29 | + } |
|
30 | 30 | |
31 | - $base = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $image)); |
|
32 | - $image = \Image::make($base); |
|
31 | + $base = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $image)); |
|
32 | + $image = \Image::make($base); |
|
33 | 33 | |
34 | - return $this->saveImage($image, $dir); |
|
35 | - } |
|
34 | + return $this->saveImage($image, $dir); |
|
35 | + } |
|
36 | 36 | |
37 | - /** |
|
38 | - * Delete the given image. |
|
39 | - * |
|
40 | - * @param object $path |
|
41 | - * @return void |
|
42 | - */ |
|
43 | - public function deleteImage($path) |
|
44 | - { |
|
45 | - \Storage::delete($path); |
|
46 | - } |
|
37 | + /** |
|
38 | + * Delete the given image. |
|
39 | + * |
|
40 | + * @param object $path |
|
41 | + * @return void |
|
42 | + */ |
|
43 | + public function deleteImage($path) |
|
44 | + { |
|
45 | + \Storage::delete($path); |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * Save the given image. |
|
50 | - * |
|
51 | - * @param object $image |
|
52 | - * @param string $dir |
|
53 | - * @return string |
|
54 | - */ |
|
55 | - protected function saveImage($image, $dir) |
|
56 | - { |
|
57 | - $imageName = 'image'.uniqid().time().'.jpg'; |
|
58 | - $path = 'public'.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR.$imageName; |
|
59 | - \Storage::put($path, $image->stream()); |
|
48 | + /** |
|
49 | + * Save the given image. |
|
50 | + * |
|
51 | + * @param object $image |
|
52 | + * @param string $dir |
|
53 | + * @return string |
|
54 | + */ |
|
55 | + protected function saveImage($image, $dir) |
|
56 | + { |
|
57 | + $imageName = 'image'.uniqid().time().'.jpg'; |
|
58 | + $path = 'public'.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR.$imageName; |
|
59 | + \Storage::put($path, $image->stream()); |
|
60 | 60 | |
61 | - return $path; |
|
62 | - } |
|
61 | + return $path; |
|
62 | + } |
|
63 | 63 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | */ |
25 | 25 | public function uploadImageBas64($image, $dir) |
26 | 26 | { |
27 | - if (! strlen($image)) { |
|
27 | + if ( ! strlen($image)) { |
|
28 | 28 | return null; |
29 | 29 | } |
30 | 30 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | return $values; |
39 | 39 | } |
40 | 40 | |
41 | - if (! $primaryLocale || ! is_object($values) || ! property_exists($values, $primaryLocale)) { |
|
41 | + if ( ! $primaryLocale || ! is_object($values) || ! property_exists($values, $primaryLocale)) { |
|
42 | 42 | return $values ? isset($values->$fallbackLocale) ? $values->$fallbackLocale : $values : ''; |
43 | 43 | } |
44 | 44 |
@@ -4,46 +4,46 @@ |
||
4 | 4 | |
5 | 5 | trait Translatable |
6 | 6 | { |
7 | - /** |
|
8 | - * Create a new model instance that is existing. |
|
9 | - * |
|
10 | - * @param array $attributes |
|
11 | - * @param string|null $connection |
|
12 | - * @return static |
|
13 | - */ |
|
14 | - public function newFromBuilder($attributes = [], $connection = null) |
|
15 | - { |
|
16 | - $model = parent::newFromBuilder($attributes, $connection); |
|
17 | - |
|
18 | - foreach ($model->attributes as $key => $value) { |
|
19 | - if (isset($this->translatable) && in_array($key, $this->translatable)) { |
|
20 | - $model->$key = $this->getTranslatedAttribute($value); |
|
21 | - } |
|
22 | - } |
|
23 | - |
|
24 | - return $model; |
|
25 | - } |
|
26 | - |
|
27 | - /** |
|
28 | - * Returns a translatable model attribute based on the application's locale settings. |
|
29 | - * |
|
30 | - * @param $values |
|
31 | - * @return string |
|
32 | - */ |
|
33 | - protected function getTranslatedAttribute($values) |
|
34 | - { |
|
35 | - $values = json_decode($values); |
|
36 | - $primaryLocale = \Session::get('locale'); |
|
37 | - $fallbackLocale = 'en'; |
|
38 | - |
|
39 | - if ($primaryLocale == 'all') { |
|
40 | - return $values; |
|
41 | - } |
|
42 | - |
|
43 | - if (! $primaryLocale || ! is_object($values) || ! property_exists($values, $primaryLocale)) { |
|
44 | - return $values ? isset($values->$fallbackLocale) ? $values->$fallbackLocale : $values : ''; |
|
45 | - } |
|
46 | - |
|
47 | - return $primaryLocale == 'all' ? $values : $values->$primaryLocale; |
|
48 | - } |
|
7 | + /** |
|
8 | + * Create a new model instance that is existing. |
|
9 | + * |
|
10 | + * @param array $attributes |
|
11 | + * @param string|null $connection |
|
12 | + * @return static |
|
13 | + */ |
|
14 | + public function newFromBuilder($attributes = [], $connection = null) |
|
15 | + { |
|
16 | + $model = parent::newFromBuilder($attributes, $connection); |
|
17 | + |
|
18 | + foreach ($model->attributes as $key => $value) { |
|
19 | + if (isset($this->translatable) && in_array($key, $this->translatable)) { |
|
20 | + $model->$key = $this->getTranslatedAttribute($value); |
|
21 | + } |
|
22 | + } |
|
23 | + |
|
24 | + return $model; |
|
25 | + } |
|
26 | + |
|
27 | + /** |
|
28 | + * Returns a translatable model attribute based on the application's locale settings. |
|
29 | + * |
|
30 | + * @param $values |
|
31 | + * @return string |
|
32 | + */ |
|
33 | + protected function getTranslatedAttribute($values) |
|
34 | + { |
|
35 | + $values = json_decode($values); |
|
36 | + $primaryLocale = \Session::get('locale'); |
|
37 | + $fallbackLocale = 'en'; |
|
38 | + |
|
39 | + if ($primaryLocale == 'all') { |
|
40 | + return $values; |
|
41 | + } |
|
42 | + |
|
43 | + if (! $primaryLocale || ! is_object($values) || ! property_exists($values, $primaryLocale)) { |
|
44 | + return $values ? isset($values->$fallbackLocale) ? $values->$fallbackLocale : $values : ''; |
|
45 | + } |
|
46 | + |
|
47 | + return $primaryLocale == 'all' ? $values : $values->$primaryLocale; |
|
48 | + } |
|
49 | 49 | } |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | return [ |
4 | 4 | |
5 | - /** |
|
6 | - * Here goes your notification messages. |
|
7 | - */ |
|
5 | + /** |
|
6 | + * Here goes your notification messages. |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | ]; |
@@ -9,41 +9,41 @@ |
||
9 | 9 | |
10 | 10 | class ConfirmEmail extends Notification implements ShouldQueue |
11 | 11 | { |
12 | - use Queueable; |
|
12 | + use Queueable; |
|
13 | 13 | |
14 | - /** |
|
15 | - * Init new object. |
|
16 | - * |
|
17 | - * @return void |
|
18 | - */ |
|
19 | - public function __construct() |
|
20 | - { |
|
21 | - // |
|
22 | - } |
|
14 | + /** |
|
15 | + * Init new object. |
|
16 | + * |
|
17 | + * @return void |
|
18 | + */ |
|
19 | + public function __construct() |
|
20 | + { |
|
21 | + // |
|
22 | + } |
|
23 | 23 | |
24 | - /** |
|
25 | - * Get the notification's delivery channels. |
|
26 | - * |
|
27 | - * @param mixed $notifiable |
|
28 | - * @return string[] |
|
29 | - */ |
|
30 | - public function via($notifiable) |
|
31 | - { |
|
32 | - return ['mail']; |
|
33 | - } |
|
24 | + /** |
|
25 | + * Get the notification's delivery channels. |
|
26 | + * |
|
27 | + * @param mixed $notifiable |
|
28 | + * @return string[] |
|
29 | + */ |
|
30 | + public function via($notifiable) |
|
31 | + { |
|
32 | + return ['mail']; |
|
33 | + } |
|
34 | 34 | |
35 | - /** |
|
36 | - * Get the mail representation of the notification. |
|
37 | - * |
|
38 | - * @param mixed $notifiable |
|
39 | - * @return \Illuminate\Notifications\Messages\MailMessage |
|
40 | - */ |
|
41 | - public function toMail($notifiable) |
|
42 | - { |
|
43 | - return (new MailMessage) |
|
44 | - ->subject('Email verification') |
|
45 | - ->line('Email verification') |
|
46 | - ->line('To validate your email click on the button below') |
|
47 | - ->action('Verify your email', config('skeleton.confrim_email_url').'/'.$notifiable->confirmation_code); |
|
48 | - } |
|
35 | + /** |
|
36 | + * Get the mail representation of the notification. |
|
37 | + * |
|
38 | + * @param mixed $notifiable |
|
39 | + * @return \Illuminate\Notifications\Messages\MailMessage |
|
40 | + */ |
|
41 | + public function toMail($notifiable) |
|
42 | + { |
|
43 | + return (new MailMessage) |
|
44 | + ->subject('Email verification') |
|
45 | + ->line('Email verification') |
|
46 | + ->line('To validate your email click on the button below') |
|
47 | + ->action('Verify your email', config('skeleton.confrim_email_url').'/'.$notifiable->confirmation_code); |
|
48 | + } |
|
49 | 49 | } |
@@ -9,43 +9,43 @@ |
||
9 | 9 | |
10 | 10 | class ResetPassword extends Notification implements ShouldQueue |
11 | 11 | { |
12 | - use Queueable; |
|
12 | + use Queueable; |
|
13 | 13 | |
14 | - protected $token; |
|
14 | + protected $token; |
|
15 | 15 | |
16 | - /** |
|
17 | - * Init new object. |
|
18 | - * |
|
19 | - * @return void |
|
20 | - */ |
|
21 | - public function __construct($token) |
|
22 | - { |
|
23 | - $this->token = $token; |
|
24 | - } |
|
16 | + /** |
|
17 | + * Init new object. |
|
18 | + * |
|
19 | + * @return void |
|
20 | + */ |
|
21 | + public function __construct($token) |
|
22 | + { |
|
23 | + $this->token = $token; |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * Get the notification's delivery channels. |
|
28 | - * |
|
29 | - * @param mixed $notifiable |
|
30 | - * @return string[] |
|
31 | - */ |
|
32 | - public function via($notifiable) |
|
33 | - { |
|
34 | - return ['mail']; |
|
35 | - } |
|
26 | + /** |
|
27 | + * Get the notification's delivery channels. |
|
28 | + * |
|
29 | + * @param mixed $notifiable |
|
30 | + * @return string[] |
|
31 | + */ |
|
32 | + public function via($notifiable) |
|
33 | + { |
|
34 | + return ['mail']; |
|
35 | + } |
|
36 | 36 | |
37 | - /** |
|
38 | - * Get the mail representation of the notification. |
|
39 | - * |
|
40 | - * @param mixed $notifiable |
|
41 | - * @return \Illuminate\Notifications\Messages\MailMessage |
|
42 | - */ |
|
43 | - public function toMail($notifiable) |
|
44 | - { |
|
45 | - return (new MailMessage) |
|
46 | - ->subject('Reset passowrd') |
|
47 | - ->line('Reset passowrd') |
|
48 | - ->line('To reset your password click on the button below') |
|
49 | - ->action('Reset password', config('skeleton.reset_password_url').'/'.$this->token); |
|
50 | - } |
|
37 | + /** |
|
38 | + * Get the mail representation of the notification. |
|
39 | + * |
|
40 | + * @param mixed $notifiable |
|
41 | + * @return \Illuminate\Notifications\Messages\MailMessage |
|
42 | + */ |
|
43 | + public function toMail($notifiable) |
|
44 | + { |
|
45 | + return (new MailMessage) |
|
46 | + ->subject('Reset passowrd') |
|
47 | + ->line('Reset passowrd') |
|
48 | + ->line('To reset your password click on the button below') |
|
49 | + ->action('Reset password', config('skeleton.reset_password_url').'/'.$this->token); |
|
50 | + } |
|
51 | 51 | } |
@@ -2,15 +2,15 @@ |
||
2 | 2 | |
3 | 3 | interface BaseFactoryInterface |
4 | 4 | { |
5 | - /** |
|
6 | - * Construct the repository class name based on |
|
7 | - * the method name called, search in the |
|
8 | - * given namespaces for the class and |
|
9 | - * return an instance. |
|
10 | - * |
|
11 | - * @param string $name the called method name |
|
12 | - * @param array $arguments the method arguments |
|
13 | - * @return object |
|
14 | - */ |
|
15 | - public function __call($name, $arguments); |
|
5 | + /** |
|
6 | + * Construct the repository class name based on |
|
7 | + * the method name called, search in the |
|
8 | + * given namespaces for the class and |
|
9 | + * return an instance. |
|
10 | + * |
|
11 | + * @param string $name the called method name |
|
12 | + * @param array $arguments the method arguments |
|
13 | + * @return object |
|
14 | + */ |
|
15 | + public function __call($name, $arguments); |
|
16 | 16 | } |
@@ -6,46 +6,46 @@ |
||
6 | 6 | |
7 | 7 | class NotificationsTableSeeder extends Seeder |
8 | 8 | { |
9 | - /** |
|
10 | - * Run the database seeds. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function run() |
|
15 | - { |
|
16 | - /** |
|
17 | - * Insert the permissions related to settings table. |
|
18 | - */ |
|
19 | - \DB::table('permissions')->insert( |
|
20 | - [ |
|
21 | - /** |
|
22 | - * notifications model permissions. |
|
23 | - */ |
|
24 | - [ |
|
25 | - 'name' => 'all', |
|
26 | - 'model' => 'notification', |
|
27 | - 'created_at' => \DB::raw('NOW()'), |
|
28 | - 'updated_at' => \DB::raw('NOW()') |
|
29 | - ], |
|
30 | - [ |
|
31 | - 'name' => 'unread', |
|
32 | - 'model' => 'notification', |
|
33 | - 'created_at' => \DB::raw('NOW()'), |
|
34 | - 'updated_at' => \DB::raw('NOW()') |
|
35 | - ], |
|
36 | - [ |
|
37 | - 'name' => 'markAsRead', |
|
38 | - 'model' => 'notification', |
|
39 | - 'created_at' => \DB::raw('NOW()'), |
|
40 | - 'updated_at' => \DB::raw('NOW()') |
|
41 | - ], |
|
42 | - [ |
|
43 | - 'name' => 'markAllAsRead', |
|
44 | - 'model' => 'notification', |
|
45 | - 'created_at' => \DB::raw('NOW()'), |
|
46 | - 'updated_at' => \DB::raw('NOW()') |
|
47 | - ] |
|
48 | - ] |
|
49 | - ); |
|
50 | - } |
|
9 | + /** |
|
10 | + * Run the database seeds. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function run() |
|
15 | + { |
|
16 | + /** |
|
17 | + * Insert the permissions related to settings table. |
|
18 | + */ |
|
19 | + \DB::table('permissions')->insert( |
|
20 | + [ |
|
21 | + /** |
|
22 | + * notifications model permissions. |
|
23 | + */ |
|
24 | + [ |
|
25 | + 'name' => 'all', |
|
26 | + 'model' => 'notification', |
|
27 | + 'created_at' => \DB::raw('NOW()'), |
|
28 | + 'updated_at' => \DB::raw('NOW()') |
|
29 | + ], |
|
30 | + [ |
|
31 | + 'name' => 'unread', |
|
32 | + 'model' => 'notification', |
|
33 | + 'created_at' => \DB::raw('NOW()'), |
|
34 | + 'updated_at' => \DB::raw('NOW()') |
|
35 | + ], |
|
36 | + [ |
|
37 | + 'name' => 'markAsRead', |
|
38 | + 'model' => 'notification', |
|
39 | + 'created_at' => \DB::raw('NOW()'), |
|
40 | + 'updated_at' => \DB::raw('NOW()') |
|
41 | + ], |
|
42 | + [ |
|
43 | + 'name' => 'markAllAsRead', |
|
44 | + 'model' => 'notification', |
|
45 | + 'created_at' => \DB::raw('NOW()'), |
|
46 | + 'updated_at' => \DB::raw('NOW()') |
|
47 | + ] |
|
48 | + ] |
|
49 | + ); |
|
50 | + } |
|
51 | 51 | } |