@@ -1,25 +1,25 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -namespace App; |
|
| 3 | + namespace App; |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Class Singleton. |
| 7 | 7 | */ |
| 8 | -abstract class Singleton |
|
| 9 | -{ |
|
| 10 | - /** |
|
| 8 | + abstract class Singleton |
|
| 9 | + { |
|
| 10 | + /** |
|
| 11 | 11 | * Create and return a User instance. |
| 12 | 12 | * |
| 13 | 13 | * @return $this |
| 14 | 14 | */ |
| 15 | - public static function getInstance() |
|
| 16 | - { |
|
| 17 | - static $instance = null; |
|
| 15 | + public static function getInstance() |
|
| 16 | + { |
|
| 17 | + static $instance = null; |
|
| 18 | 18 | |
| 19 | - if ($instance === null) { |
|
| 20 | - $instance = new static(); |
|
| 21 | - } |
|
| 19 | + if ($instance === null) { |
|
| 20 | + $instance = new static(); |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - return $instance; |
|
| 24 | - } |
|
| 23 | + return $instance; |
|
| 24 | + } |
|
| 25 | 25 | } |
@@ -1,21 +1,21 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -namespace App\Facades; |
|
| 3 | + namespace App\Facades; |
|
| 4 | 4 | |
| 5 | -use Illuminate\Support\Facades\Facade; |
|
| 5 | + use Illuminate\Support\Facades\Facade; |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * Class Validation. |
| 9 | 9 | */ |
| 10 | -class Validation extends Facade |
|
| 11 | -{ |
|
| 12 | - /** |
|
| 10 | + class Validation extends Facade |
|
| 11 | + { |
|
| 12 | + /** |
|
| 13 | 13 | * Get the registered name of the component. |
| 14 | 14 | * |
| 15 | 15 | * @return string |
| 16 | 16 | */ |
| 17 | - protected static function getFacadeAccessor() |
|
| 18 | - { |
|
| 19 | - return 'chocovalidate'; |
|
| 20 | - } |
|
| 17 | + protected static function getFacadeAccessor() |
|
| 18 | + { |
|
| 19 | + return 'chocovalidate'; |
|
| 20 | + } |
|
| 21 | 21 | } |
@@ -1,52 +1,52 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -namespace App\Models; |
|
| 3 | + namespace App\Models; |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Class NuxValidation. |
| 7 | 7 | */ |
| 8 | -class NuxValidation |
|
| 9 | -{ |
|
| 10 | - /** |
|
| 8 | + class NuxValidation |
|
| 9 | + { |
|
| 10 | + /** |
|
| 11 | 11 | * Result Code. |
| 12 | 12 | * |
| 13 | 13 | * @var string |
| 14 | 14 | */ |
| 15 | - public $code; |
|
| 15 | + public $code; |
|
| 16 | 16 | |
| 17 | - /** |
|
| 17 | + /** |
|
| 18 | 18 | * Specification of what Happened. |
| 19 | 19 | * |
| 20 | 20 | * @var array|null |
| 21 | 21 | */ |
| 22 | - public $validationResult = null; |
|
| 22 | + public $validationResult = null; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 24 | + /** |
|
| 25 | 25 | * Username Suggestions. |
| 26 | 26 | * |
| 27 | 27 | * @TODO: Code Suggestions |
| 28 | 28 | * |
| 29 | 29 | * @var array|null |
| 30 | 30 | */ |
| 31 | - public $suggestions = []; |
|
| 31 | + public $suggestions = []; |
|
| 32 | 32 | |
| 33 | - /** |
|
| 33 | + /** |
|
| 34 | 34 | * Create a NUX Validation. |
| 35 | 35 | * |
| 36 | 36 | * @param string $code |
| 37 | 37 | * @param array $validationResult |
| 38 | 38 | * @param array $suggestions |
| 39 | 39 | */ |
| 40 | - public function __construct(string $code = 'OK', array $validationResult = [], array $suggestions = []) |
|
| 41 | - { |
|
| 42 | - $this->code = $code; |
|
| 40 | + public function __construct(string $code = 'OK', array $validationResult = [], array $suggestions = []) |
|
| 41 | + { |
|
| 42 | + $this->code = $code; |
|
| 43 | 43 | |
| 44 | - if (!empty($validationResult)) { |
|
| 45 | - $this->validationResult = $validationResult; |
|
| 46 | - } |
|
| 44 | + if (!empty($validationResult)) { |
|
| 45 | + $this->validationResult = $validationResult; |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - if (!empty($suggestions)) { |
|
| 49 | - $this->suggestions = $suggestions; |
|
| 50 | - } |
|
| 51 | - } |
|
| 48 | + if (!empty($suggestions)) { |
|
| 49 | + $this->suggestions = $suggestions; |
|
| 50 | + } |
|
| 51 | + } |
|
| 52 | 52 | } |
@@ -1,37 +1,37 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -namespace App\Models; |
|
| 3 | + namespace App\Models; |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Class UserSettings. |
| 7 | 7 | */ |
| 8 | -class UserSettings extends ChocolateyModel |
|
| 9 | -{ |
|
| 10 | - /** |
|
| 8 | + class UserSettings extends ChocolateyModel |
|
| 9 | + { |
|
| 10 | + /** |
|
| 11 | 11 | * Disable Timestamps. |
| 12 | 12 | * |
| 13 | 13 | * @var bool |
| 14 | 14 | */ |
| 15 | - public $timestamps = false; |
|
| 15 | + public $timestamps = false; |
|
| 16 | 16 | |
| 17 | - /** |
|
| 17 | + /** |
|
| 18 | 18 | * The table associated with the model. |
| 19 | 19 | * |
| 20 | 20 | * @var string |
| 21 | 21 | */ |
| 22 | - protected $table = 'users_settings'; |
|
| 22 | + protected $table = 'users_settings'; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 24 | + /** |
|
| 25 | 25 | * The attributes that are mass assignable. |
| 26 | 26 | * |
| 27 | 27 | * @var array |
| 28 | 28 | */ |
| 29 | - protected $fillable = ['user_id', 'block_following', 'block_friendrequests']; |
|
| 29 | + protected $fillable = ['user_id', 'block_following', 'block_friendrequests']; |
|
| 30 | 30 | |
| 31 | - /** |
|
| 31 | + /** |
|
| 32 | 32 | * Primary Key of the Table. |
| 33 | 33 | * |
| 34 | 34 | * @var string |
| 35 | 35 | */ |
| 36 | - protected $primaryKey = 'id'; |
|
| 36 | + protected $primaryKey = 'id'; |
|
| 37 | 37 | } |
@@ -1,101 +1,101 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -namespace App\Models; |
|
| 3 | + namespace App\Models; |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Class UserFriend. |
| 7 | 7 | */ |
| 8 | -class UserFriend extends ChocolateyModel |
|
| 9 | -{ |
|
| 10 | - /** |
|
| 8 | + class UserFriend extends ChocolateyModel |
|
| 9 | + { |
|
| 10 | + /** |
|
| 11 | 11 | * Disable Timestamps. |
| 12 | 12 | * |
| 13 | 13 | * @var bool |
| 14 | 14 | */ |
| 15 | - public $timestamps = false; |
|
| 15 | + public $timestamps = false; |
|
| 16 | 16 | |
| 17 | - /** |
|
| 17 | + /** |
|
| 18 | 18 | * The table associated with the model. |
| 19 | 19 | * |
| 20 | 20 | * @var string |
| 21 | 21 | */ |
| 22 | - protected $table = 'messenger_friendships'; |
|
| 22 | + protected $table = 'messenger_friendships'; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 24 | + /** |
|
| 25 | 25 | * Primary Key of the Table. |
| 26 | 26 | * |
| 27 | 27 | * @var string |
| 28 | 28 | */ |
| 29 | - protected $primaryKey = 'id'; |
|
| 29 | + protected $primaryKey = 'id'; |
|
| 30 | 30 | |
| 31 | - /** |
|
| 31 | + /** |
|
| 32 | 32 | * User Friend Data. |
| 33 | 33 | * |
| 34 | 34 | * @var User |
| 35 | 35 | */ |
| 36 | - protected $friendData; |
|
| 36 | + protected $friendData; |
|
| 37 | 37 | |
| 38 | - /** |
|
| 38 | + /** |
|
| 39 | 39 | * The attributes excluded from the model's JSON form. |
| 40 | 40 | * |
| 41 | 41 | * @var array |
| 42 | 42 | */ |
| 43 | - protected $hidden = ['user_one_id', 'user_two_id', 'relation', 'friends_since']; |
|
| 43 | + protected $hidden = ['user_one_id', 'user_two_id', 'relation', 'friends_since']; |
|
| 44 | 44 | |
| 45 | - /** |
|
| 45 | + /** |
|
| 46 | 46 | * The Appender(s) of the Model. |
| 47 | 47 | * |
| 48 | 48 | * @var array |
| 49 | 49 | */ |
| 50 | - protected $appends = ['figureString', 'motto', 'name', 'uniqueId']; |
|
| 50 | + protected $appends = ['figureString', 'motto', 'name', 'uniqueId']; |
|
| 51 | 51 | |
| 52 | - /** |
|
| 52 | + /** |
|
| 53 | 53 | * Get User Friend Figure String. |
| 54 | 54 | * |
| 55 | 55 | * @return string |
| 56 | 56 | */ |
| 57 | - public function getFigureStringAttribute(): string |
|
| 58 | - { |
|
| 59 | - return $this->getUserFriendData()->figureString; |
|
| 60 | - } |
|
| 57 | + public function getFigureStringAttribute(): string |
|
| 58 | + { |
|
| 59 | + return $this->getUserFriendData()->figureString; |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | - /** |
|
| 62 | + /** |
|
| 63 | 63 | * Get User Friend Data. |
| 64 | 64 | * |
| 65 | 65 | * @return User |
| 66 | 66 | */ |
| 67 | - protected function getUserFriendData(): User |
|
| 68 | - { |
|
| 69 | - return User::find($this->attributes['user_two_id']); |
|
| 70 | - } |
|
| 67 | + protected function getUserFriendData(): User |
|
| 68 | + { |
|
| 69 | + return User::find($this->attributes['user_two_id']); |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | - /** |
|
| 72 | + /** |
|
| 73 | 73 | * Get User Friend Motto. |
| 74 | 74 | * |
| 75 | 75 | * @return string |
| 76 | 76 | */ |
| 77 | - public function getMottoAttribute(): string |
|
| 78 | - { |
|
| 79 | - return $this->getUserFriendData()->motto; |
|
| 80 | - } |
|
| 77 | + public function getMottoAttribute(): string |
|
| 78 | + { |
|
| 79 | + return $this->getUserFriendData()->motto; |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - /** |
|
| 82 | + /** |
|
| 83 | 83 | * Get User Friend Name. |
| 84 | 84 | * |
| 85 | 85 | * @return string |
| 86 | 86 | */ |
| 87 | - public function getNameAttribute(): string |
|
| 88 | - { |
|
| 89 | - return $this->getUserFriendData()->name; |
|
| 90 | - } |
|
| 87 | + public function getNameAttribute(): string |
|
| 88 | + { |
|
| 89 | + return $this->getUserFriendData()->name; |
|
| 90 | + } |
|
| 91 | 91 | |
| 92 | - /** |
|
| 92 | + /** |
|
| 93 | 93 | * Get User Friend UniqueId. |
| 94 | 94 | * |
| 95 | 95 | * @return int |
| 96 | 96 | */ |
| 97 | - public function getUniqueIdAttribute(): int |
|
| 98 | - { |
|
| 99 | - return $this->getUserFriendData()->uniqueId; |
|
| 100 | - } |
|
| 97 | + public function getUniqueIdAttribute(): int |
|
| 98 | + { |
|
| 99 | + return $this->getUserFriendData()->uniqueId; |
|
| 100 | + } |
|
| 101 | 101 | } |
@@ -1,30 +1,30 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -namespace App\Models; |
|
| 3 | + namespace App\Models; |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Class UserCurrency. |
| 7 | 7 | */ |
| 8 | -class UserCurrency extends ChocolateyModel |
|
| 9 | -{ |
|
| 10 | - /** |
|
| 8 | + class UserCurrency extends ChocolateyModel |
|
| 9 | + { |
|
| 10 | + /** |
|
| 11 | 11 | * Disable Timestamps. |
| 12 | 12 | * |
| 13 | 13 | * @var bool |
| 14 | 14 | */ |
| 15 | - public $timestamps = false; |
|
| 15 | + public $timestamps = false; |
|
| 16 | 16 | |
| 17 | - /** |
|
| 17 | + /** |
|
| 18 | 18 | * The table associated with the model. |
| 19 | 19 | * |
| 20 | 20 | * @var string |
| 21 | 21 | */ |
| 22 | - protected $table = 'users_currency'; |
|
| 22 | + protected $table = 'users_currency'; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 24 | + /** |
|
| 25 | 25 | * Primary Key of the Table. |
| 26 | 26 | * |
| 27 | 27 | * @var string |
| 28 | 28 | */ |
| 29 | - protected $primaryKey = 'id'; |
|
| 29 | + protected $primaryKey = 'id'; |
|
| 30 | 30 | } |
@@ -1,145 +1,145 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -namespace App\Models; |
|
| 3 | + namespace App\Models; |
|
| 4 | 4 | |
| 5 | -use Sofa\Eloquence\Eloquence; |
|
| 6 | -use Sofa\Eloquence\Mappable; |
|
| 5 | + use Sofa\Eloquence\Eloquence; |
|
| 6 | + use Sofa\Eloquence\Mappable; |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * Class Photo. |
| 10 | 10 | */ |
| 11 | -class Photo extends ChocolateyModel |
|
| 12 | -{ |
|
| 13 | - use Eloquence, Mappable; |
|
| 11 | + class Photo extends ChocolateyModel |
|
| 12 | + { |
|
| 13 | + use Eloquence, Mappable; |
|
| 14 | 14 | |
| 15 | - /** |
|
| 15 | + /** |
|
| 16 | 16 | * The table associated with the model. |
| 17 | 17 | * |
| 18 | 18 | * @var string |
| 19 | 19 | */ |
| 20 | - protected $table = 'camera_web'; |
|
| 20 | + protected $table = 'camera_web'; |
|
| 21 | 21 | |
| 22 | - /** |
|
| 22 | + /** |
|
| 23 | 23 | * Primary Key of the Table. |
| 24 | 24 | * |
| 25 | 25 | * @var string |
| 26 | 26 | */ |
| 27 | - protected $primaryKey = 'id'; |
|
| 27 | + protected $primaryKey = 'id'; |
|
| 28 | 28 | |
| 29 | - /** |
|
| 29 | + /** |
|
| 30 | 30 | * The attributes that will be mapped. |
| 31 | 31 | * |
| 32 | 32 | * @var array |
| 33 | 33 | */ |
| 34 | - protected $maps = ['creator_id' => 'user_id', 'previewUrl' => 'url', 'creator_uniqueId' => 'user_id', 'time' => 'timestamp']; |
|
| 34 | + protected $maps = ['creator_id' => 'user_id', 'previewUrl' => 'url', 'creator_uniqueId' => 'user_id', 'time' => 'timestamp']; |
|
| 35 | 35 | |
| 36 | - /** |
|
| 36 | + /** |
|
| 37 | 37 | * The Appender(s) of the Model. |
| 38 | 38 | * |
| 39 | 39 | * @var array |
| 40 | 40 | */ |
| 41 | - protected $appends = ['creator_uniqueId', 'version', 'previewUrl', 'creator_id', 'likes', 'tags', 'version', 'type', 'room_id', 'creator_name']; |
|
| 41 | + protected $appends = ['creator_uniqueId', 'version', 'previewUrl', 'creator_id', 'likes', 'tags', 'version', 'type', 'room_id', 'creator_name']; |
|
| 42 | 42 | |
| 43 | - /** |
|
| 43 | + /** |
|
| 44 | 44 | * The attributes that should be casted to native types. |
| 45 | 45 | * |
| 46 | 46 | * @var array |
| 47 | 47 | */ |
| 48 | - protected $casts = ['tags' => 'array', 'creator_uniqueId' => 'string']; |
|
| 48 | + protected $casts = ['tags' => 'array', 'creator_uniqueId' => 'string']; |
|
| 49 | 49 | |
| 50 | - /** |
|
| 50 | + /** |
|
| 51 | 51 | * Get the Unique Id of the Photo. |
| 52 | 52 | * |
| 53 | 53 | * @return string |
| 54 | 54 | */ |
| 55 | - public function getIdAttribute(): string |
|
| 56 | - { |
|
| 57 | - return (string) $this->attributes['id']; |
|
| 58 | - } |
|
| 55 | + public function getIdAttribute(): string |
|
| 56 | + { |
|
| 57 | + return (string) $this->attributes['id']; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - /** |
|
| 60 | + /** |
|
| 61 | 61 | * Get the URL of the Photo. |
| 62 | 62 | * |
| 63 | 63 | * @return string |
| 64 | 64 | */ |
| 65 | - public function getUrlAttribute(): string |
|
| 66 | - { |
|
| 67 | - return str_replace('http:', '', str_replace('https:', '', $this->attributes['url'])); |
|
| 68 | - } |
|
| 65 | + public function getUrlAttribute(): string |
|
| 66 | + { |
|
| 67 | + return str_replace('http:', '', str_replace('https:', '', $this->attributes['url'])); |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - /** |
|
| 70 | + /** |
|
| 71 | 71 | * Get the Version Attribute. |
| 72 | 72 | * |
| 73 | 73 | * @return int |
| 74 | 74 | */ |
| 75 | - public function getVersionAttribute(): int |
|
| 76 | - { |
|
| 77 | - return 1; |
|
| 78 | - } |
|
| 75 | + public function getVersionAttribute(): int |
|
| 76 | + { |
|
| 77 | + return 1; |
|
| 78 | + } |
|
| 79 | 79 | |
| 80 | - /** |
|
| 80 | + /** |
|
| 81 | 81 | * Get All Tags |
| 82 | 82 | * Transforming it on an Array. |
| 83 | 83 | * |
| 84 | 84 | * @return array(string) |
| 85 | 85 | */ |
| 86 | - public function getTagsAttribute(): array |
|
| 87 | - { |
|
| 88 | - return []; |
|
| 89 | - } |
|
| 86 | + public function getTagsAttribute(): array |
|
| 87 | + { |
|
| 88 | + return []; |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - /** |
|
| 91 | + /** |
|
| 92 | 92 | * Get Formatted Time |
| 93 | 93 | * Convert Date to UNIX Timestamp. |
| 94 | 94 | * |
| 95 | 95 | * @return int |
| 96 | 96 | */ |
| 97 | - public function getTimeAttribute(): int |
|
| 98 | - { |
|
| 99 | - return strtotime($this->attributes['timestamp']) * 1000; |
|
| 100 | - } |
|
| 97 | + public function getTimeAttribute(): int |
|
| 98 | + { |
|
| 99 | + return strtotime($this->attributes['timestamp']) * 1000; |
|
| 100 | + } |
|
| 101 | 101 | |
| 102 | - /** |
|
| 102 | + /** |
|
| 103 | 103 | * Get Photo Likes Directly as Username. |
| 104 | 104 | * |
| 105 | 105 | * @return array |
| 106 | 106 | */ |
| 107 | - public function getLikesAttribute(): array |
|
| 108 | - { |
|
| 109 | - return array_map(function (array $item) { |
|
| 110 | - return $item['username']; |
|
| 111 | - }, PhotoLike::query()->select('username')->where('photo_id', $this->attributes['id'])->get(['username'])->toArray()); |
|
| 112 | - } |
|
| 113 | - |
|
| 114 | - /** |
|
| 107 | + public function getLikesAttribute(): array |
|
| 108 | + { |
|
| 109 | + return array_map(function (array $item) { |
|
| 110 | + return $item['username']; |
|
| 111 | + }, PhotoLike::query()->select('username')->where('photo_id', $this->attributes['id'])->get(['username'])->toArray()); |
|
| 112 | + } |
|
| 113 | + |
|
| 114 | + /** |
|
| 115 | 115 | * Get the Photo Type Attribute. |
| 116 | 116 | * |
| 117 | 117 | * @return string |
| 118 | 118 | */ |
| 119 | - public function getTypeAttribute(): string |
|
| 120 | - { |
|
| 121 | - return 'PHOTO'; |
|
| 122 | - } |
|
| 119 | + public function getTypeAttribute(): string |
|
| 120 | + { |
|
| 121 | + return 'PHOTO'; |
|
| 122 | + } |
|
| 123 | 123 | |
| 124 | - /** |
|
| 124 | + /** |
|
| 125 | 125 | * Get Room Id. |
| 126 | 126 | * |
| 127 | 127 | * @TODO: Add real RoomID |
| 128 | 128 | * |
| 129 | 129 | * @return int |
| 130 | 130 | */ |
| 131 | - public function getRoomIdAttribute(): int |
|
| 132 | - { |
|
| 133 | - return 1; |
|
| 134 | - } |
|
| 131 | + public function getRoomIdAttribute(): int |
|
| 132 | + { |
|
| 133 | + return 1; |
|
| 134 | + } |
|
| 135 | 135 | |
| 136 | - /** |
|
| 136 | + /** |
|
| 137 | 137 | * Get User Name. |
| 138 | 138 | * |
| 139 | 139 | * @return string |
| 140 | 140 | */ |
| 141 | - public function getCreatorNameAttribute(): string |
|
| 142 | - { |
|
| 143 | - return User::find($this->attributes['user_id'])->name; |
|
| 144 | - } |
|
| 141 | + public function getCreatorNameAttribute(): string |
|
| 142 | + { |
|
| 143 | + return User::find($this->attributes['user_id'])->name; |
|
| 144 | + } |
|
| 145 | 145 | } |
@@ -1,30 +1,30 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -namespace App\Models; |
|
| 3 | + namespace App\Models; |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Class EmulatorSettings. |
| 7 | 7 | */ |
| 8 | -class EmulatorSettings extends ChocolateyModel |
|
| 9 | -{ |
|
| 10 | - /** |
|
| 8 | + class EmulatorSettings extends ChocolateyModel |
|
| 9 | + { |
|
| 10 | + /** |
|
| 11 | 11 | * Disable Timestamps. |
| 12 | 12 | * |
| 13 | 13 | * @var bool |
| 14 | 14 | */ |
| 15 | - public $timestamps = false; |
|
| 15 | + public $timestamps = false; |
|
| 16 | 16 | |
| 17 | - /** |
|
| 17 | + /** |
|
| 18 | 18 | * The table associated with the model. |
| 19 | 19 | * |
| 20 | 20 | * @var string |
| 21 | 21 | */ |
| 22 | - protected $table = 'emulator_settings'; |
|
| 22 | + protected $table = 'emulator_settings'; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 24 | + /** |
|
| 25 | 25 | * Primary Key of the Table. |
| 26 | 26 | * |
| 27 | 27 | * @var string |
| 28 | 28 | */ |
| 29 | - protected $primaryKey = 'id'; |
|
| 29 | + protected $primaryKey = 'id'; |
|
| 30 | 30 | } |
@@ -1,66 +1,66 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -namespace App\Models; |
|
| 3 | + namespace App\Models; |
|
| 4 | 4 | |
| 5 | -use Sofa\Eloquence\Eloquence; |
|
| 6 | -use Sofa\Eloquence\Mappable; |
|
| 5 | + use Sofa\Eloquence\Eloquence; |
|
| 6 | + use Sofa\Eloquence\Mappable; |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * Class UserBadge. |
| 10 | 10 | */ |
| 11 | -class UserBadge extends ChocolateyModel |
|
| 12 | -{ |
|
| 13 | - use Eloquence, Mappable; |
|
| 11 | + class UserBadge extends ChocolateyModel |
|
| 12 | + { |
|
| 13 | + use Eloquence, Mappable; |
|
| 14 | 14 | |
| 15 | - /** |
|
| 15 | + /** |
|
| 16 | 16 | * Disable Timestamps. |
| 17 | 17 | * |
| 18 | 18 | * @var bool |
| 19 | 19 | */ |
| 20 | - public $timestamps = false; |
|
| 20 | + public $timestamps = false; |
|
| 21 | 21 | |
| 22 | - /** |
|
| 22 | + /** |
|
| 23 | 23 | * The table associated with the model. |
| 24 | 24 | * |
| 25 | 25 | * @var string |
| 26 | 26 | */ |
| 27 | - protected $table = 'users_badges'; |
|
| 27 | + protected $table = 'users_badges'; |
|
| 28 | 28 | |
| 29 | - /** |
|
| 29 | + /** |
|
| 30 | 30 | * Primary Key of the Table. |
| 31 | 31 | * |
| 32 | 32 | * @var string |
| 33 | 33 | */ |
| 34 | - protected $primaryKey = 'id'; |
|
| 34 | + protected $primaryKey = 'id'; |
|
| 35 | 35 | |
| 36 | - /** |
|
| 36 | + /** |
|
| 37 | 37 | * The attributes that will be mapped. |
| 38 | 38 | * |
| 39 | 39 | * @var array |
| 40 | 40 | */ |
| 41 | - protected $maps = ['badgeIndex' => 'slot_id', 'code' => 'badge_code', 'name' => 'badge_code']; |
|
| 41 | + protected $maps = ['badgeIndex' => 'slot_id', 'code' => 'badge_code', 'name' => 'badge_code']; |
|
| 42 | 42 | |
| 43 | - /** |
|
| 43 | + /** |
|
| 44 | 44 | * The attributes excluded from the model's JSON form. |
| 45 | 45 | * |
| 46 | 46 | * @var array |
| 47 | 47 | */ |
| 48 | - protected $hidden = ['user_id', 'badge_code', 'slot_id', 'id']; |
|
| 48 | + protected $hidden = ['user_id', 'badge_code', 'slot_id', 'id']; |
|
| 49 | 49 | |
| 50 | - /** |
|
| 50 | + /** |
|
| 51 | 51 | * The Appender(s) of the Model. |
| 52 | 52 | * |
| 53 | 53 | * @var array |
| 54 | 54 | */ |
| 55 | - protected $appends = ['description', 'badgeIndex', 'code', 'name']; |
|
| 55 | + protected $appends = ['description', 'badgeIndex', 'code', 'name']; |
|
| 56 | 56 | |
| 57 | - /** |
|
| 57 | + /** |
|
| 58 | 58 | * Get Description Attribute. |
| 59 | 59 | * |
| 60 | 60 | * @return string |
| 61 | 61 | */ |
| 62 | - public function getDescriptionAttribute(): string |
|
| 63 | - { |
|
| 64 | - return "Badge {$this->attributes['badge_code']}"; |
|
| 65 | - } |
|
| 62 | + public function getDescriptionAttribute(): string |
|
| 63 | + { |
|
| 64 | + return "Badge {$this->attributes['badge_code']}"; |
|
| 65 | + } |
|
| 66 | 66 | } |