@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @author Temitope Olotin <[email protected]> |
|
4 | - * @license <https://opensource.org/license/MIT> MIT |
|
5 | - */ |
|
3 | + * @author Temitope Olotin <[email protected]> |
|
4 | + * @license <https://opensource.org/license/MIT> MIT |
|
5 | + */ |
|
6 | 6 | namespace Laztopaz\EmojiRestfulAPI; |
7 | 7 | |
8 | 8 | use Illuminate\Database\Capsule\Manager as Capsule; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public function createUser() |
27 | 27 | { |
28 | 28 | if (!Capsule::schema()->hasTable('users')) { |
29 | - Capsule::schema()->create('users', function ($table) { |
|
29 | + Capsule::schema()->create('users', function($table) { |
|
30 | 30 | $table->increments('id'); |
31 | 31 | $table->string('firstname'); |
32 | 32 | $table->string('lastname'); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | public function createKeyword() |
45 | 45 | { |
46 | 46 | if (!Capsule::schema()->hasTable('keywords')) { |
47 | - Capsule::schema()->create('keywords', function ($table) { |
|
47 | + Capsule::schema()->create('keywords', function($table) { |
|
48 | 48 | $table->increments('id'); |
49 | 49 | $table->integer('emoji_id'); |
50 | 50 | $table->string('keyword_name'); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | public function createCategory() |
60 | 60 | { |
61 | 61 | if (!Capsule::schema()->hasTable('categories')) { |
62 | - Capsule::schema()->create('categories', function ($table) { |
|
62 | + Capsule::schema()->create('categories', function($table) { |
|
63 | 63 | $table->increments('id'); |
64 | 64 | $table->string('category_name'); |
65 | 65 | $table->timestamps(); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | public function createEmoji() |
74 | 74 | { |
75 | 75 | if (!Capsule::schema()->hasTable('emojis')) { |
76 | - Capsule::schema()->create('emojis', function ($table) { |
|
76 | + Capsule::schema()->create('emojis', function($table) { |
|
77 | 77 | $table->increments('id'); |
78 | 78 | $table->string('name'); |
79 | 79 | $table->string('char'); |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @author Temitope Olotin <[email protected]> |
|
4 | - * @license <https://opensource.org/license/MIT> MIT |
|
5 | - */ |
|
3 | + * @author Temitope Olotin <[email protected]> |
|
4 | + * @license <https://opensource.org/license/MIT> MIT |
|
5 | + */ |
|
6 | 6 | |
7 | 7 | namespace Laztopaz\EmojiRestfulAPI; |
8 | 8 |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @author Temitope Olotin <[email protected]> |
|
4 | - * @license <https://opensource.org/license/MIT> MIT |
|
5 | - */ |
|
3 | + * @author Temitope Olotin <[email protected]> |
|
4 | + * @license <https://opensource.org/license/MIT> MIT |
|
5 | + */ |
|
6 | 6 | |
7 | 7 | namespace Laztopaz\EmojiRestfulAPI; |
8 | 8 |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @author Temitope Olotin <[email protected]> |
|
4 | - * @license <https://opensource.org/license/MIT> MIT |
|
5 | - */ |
|
3 | + * @author Temitope Olotin <[email protected]> |
|
4 | + * @license <https://opensource.org/license/MIT> MIT |
|
5 | + */ |
|
6 | 6 | |
7 | 7 | namespace Laztopaz\EmojiRestfulAPI; |
8 | 8 |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @author Temitope Olotin <[email protected]> |
|
4 | - * @license <https://opensource.org/license/MIT> MIT |
|
5 | - */ |
|
3 | + * @author Temitope Olotin <[email protected]> |
|
4 | + * @license <https://opensource.org/license/MIT> MIT |
|
5 | + */ |
|
6 | 6 | |
7 | 7 | namespace Laztopaz\EmojiRestfulAPI; |
8 | 8 |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @author Temitope Olotin <[email protected]> |
|
4 | - * @license <https://opensource.org/license/MIT> MIT |
|
5 | - */ |
|
3 | + * @author Temitope Olotin <[email protected]> |
|
4 | + * @license <https://opensource.org/license/MIT> MIT |
|
5 | + */ |
|
6 | 6 | |
7 | 7 | namespace Laztopaz\EmojiRestfulAPI; |
8 | 8 |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @author Temitope Olotin <[email protected]> |
|
4 | - * @license <https://opensource.org/license/MIT> MIT |
|
5 | - */ |
|
3 | + * @author Temitope Olotin <[email protected]> |
|
4 | + * @license <https://opensource.org/license/MIT> MIT |
|
5 | + */ |
|
6 | 6 | |
7 | 7 | namespace Laztopaz\EmojiRestfulAPI; |
8 | 8 |
@@ -147,12 +147,12 @@ discard block |
||
147 | 147 | * Create the token params as an array |
148 | 148 | */ |
149 | 149 | $data = [ |
150 | - 'iat' => $issuedAt, // Issued at: time when the token was generated |
|
151 | - 'jti' => $tokenId, // Json Token Id: an unique identifier for the token |
|
152 | - 'iss' => $serverName, // Issuer |
|
153 | - 'nbf' => $notBefore, // Not before |
|
154 | - 'exp' => $expire, // Expire |
|
155 | - 'dat' => $userData, // User Information retrieved from the database |
|
150 | + 'iat' => $issuedAt, // Issued at: time when the token was generated |
|
151 | + 'jti' => $tokenId, // Json Token Id: an unique identifier for the token |
|
152 | + 'iss' => $serverName, // Issuer |
|
153 | + 'nbf' => $notBefore, // Not before |
|
154 | + 'exp' => $expire, // Expire |
|
155 | + 'dat' => $userData, // User Information retrieved from the database |
|
156 | 156 | ]; |
157 | 157 | |
158 | 158 | $loadEnv = DatabaseConnection::loadEnv(); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $secretKey = base64_decode(getenv('secret')); |
161 | 161 | |
162 | 162 | $jwt = JWT::encode( |
163 | - $data, //Data to be encoded in the JWT |
|
163 | + $data, //Data to be encoded in the JWT |
|
164 | 164 | $secretKey, // The signing key |
165 | 165 | 'HS512' // Algorithm used to sign the token |
166 | 166 | ); |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @author Temitope Olotin <[email protected]> |
|
4 | - * @license <https://opensource.org/license/MIT> MIT |
|
5 | - */ |
|
3 | + * @author Temitope Olotin <[email protected]> |
|
4 | + * @license <https://opensource.org/license/MIT> MIT |
|
5 | + */ |
|
6 | 6 | namespace Laztopaz\EmojiRestfulAPI; |
7 | 7 | |
8 | 8 | use Dotenv\Dotenv; |
@@ -48,15 +48,15 @@ discard block |
||
48 | 48 | $this->capsule->bootEloquent(); |
49 | 49 | } |
50 | 50 | |
51 | - /** |
|
52 | - * Load Dotenv to grant getenv() access to |
|
53 | - * environment variables in .env file. |
|
54 | - */ |
|
55 | - public static function loadEnv() |
|
56 | - { |
|
57 | - if (!getenv('APP_ENV')) { |
|
58 | - $dotenv = new Dotenv(__DIR__.'/../../'); |
|
59 | - $dotenv->load(); |
|
60 | - } |
|
61 | - } |
|
51 | + /** |
|
52 | + * Load Dotenv to grant getenv() access to |
|
53 | + * environment variables in .env file. |
|
54 | + */ |
|
55 | + public static function loadEnv() |
|
56 | + { |
|
57 | + if (!getenv('APP_ENV')) { |
|
58 | + $dotenv = new Dotenv(__DIR__.'/../../'); |
|
59 | + $dotenv->load(); |
|
60 | + } |
|
61 | + } |
|
62 | 62 | } |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @author Temitope Olotin <[email protected]> |
|
4 | - * @license <https://opensource.org/license/MIT> MIT |
|
5 | - */ |
|
3 | + * @author Temitope Olotin <[email protected]> |
|
4 | + * @license <https://opensource.org/license/MIT> MIT |
|
5 | + */ |
|
6 | 6 | |
7 | 7 | namespace Laztopaz\EmojiRestfulAPI; |
8 | 8 |