@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('transactions', function (Blueprint $table) { |
|
16 | + Schema::create('transactions', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->integer('user_id')->unsigned(); |
19 | 19 | $table->timestamp('transaction_date')->nullable(); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $table->timestamps(); |
31 | 31 | }); |
32 | 32 | |
33 | - Schema::table('transactions', function (Blueprint $table) { |
|
33 | + Schema::table('transactions', function(Blueprint $table) { |
|
34 | 34 | $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); |
35 | 35 | $table->foreign('status_id')->references('id')->on('transaction_status'); |
36 | 36 | $table->foreign('type_id')->references('id')->on('transaction_types'); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::table('users', function (Blueprint $table) { |
|
16 | + Schema::table('users', function(Blueprint $table) { |
|
17 | 17 | $table->boolean('disable_status')->default(false); |
18 | 18 | }); |
19 | 19 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function down() |
27 | 27 | { |
28 | - Schema::table('users', function (Blueprint $table) { |
|
28 | + Schema::table('users', function(Blueprint $table) { |
|
29 | 29 | $table->dropColumn('disable_status'); |
30 | 30 | }); |
31 | 31 | } |
@@ -8,10 +8,10 @@ |
||
8 | 8 | * |
9 | 9 | * @version 1.0 |
10 | 10 | */ |
11 | -$factory->define(App\Models\Account::class, function (Faker\Generator $faker) { |
|
11 | +$factory->define(App\Models\Account::class, function(Faker\Generator $faker) { |
|
12 | 12 | return [ |
13 | 13 | 'name' => $faker->name, |
14 | - 'user_id' => function () { |
|
14 | + 'user_id' => function() { |
|
15 | 15 | return factory(App\Models\User::class)->create()->id; |
16 | 16 | }, |
17 | 17 | ]; |
@@ -8,10 +8,10 @@ |
||
8 | 8 | * |
9 | 9 | * @version 1.0 |
10 | 10 | */ |
11 | -$factory->define(App\Models\Category::class, function (Faker\Generator $faker) { |
|
11 | +$factory->define(App\Models\Category::class, function(Faker\Generator $faker) { |
|
12 | 12 | return [ |
13 | 13 | 'name' => $faker->name, |
14 | - 'user_id' => function () { |
|
14 | + 'user_id' => function() { |
|
15 | 15 | return factory(App\Models\User::class)->create()->id; |
16 | 16 | }, |
17 | 17 | ]; |
@@ -8,7 +8,7 @@ |
||
8 | 8 | * |
9 | 9 | * @version 1.0 |
10 | 10 | */ |
11 | -$factory->define(App\Models\User::class, function (Faker\Generator $faker) { |
|
11 | +$factory->define(App\Models\User::class, function(Faker\Generator $faker) { |
|
12 | 12 | return [ |
13 | 13 | 'name' => $faker->name, |
14 | 14 | 'email' => $faker->email, |
@@ -8,7 +8,7 @@ |
||
8 | 8 | * |
9 | 9 | * @version 1.0 |
10 | 10 | */ |
11 | -$factory->define(App\Models\TransactionType::class, function (Faker\Generator $faker) { |
|
11 | +$factory->define(App\Models\TransactionType::class, function(Faker\Generator $faker) { |
|
12 | 12 | // $TypeArrayDesc = array ("Withdrawal", "Deposit", "Transfer"); |
13 | 13 | $name = implode('_', $faker->words(2)); |
14 | 14 |
@@ -8,15 +8,15 @@ |
||
8 | 8 | * |
9 | 9 | * @version 1.0 |
10 | 10 | */ |
11 | -$factory->define(App\Models\Transaction::class, function (Faker\Generator $faker) { |
|
11 | +$factory->define(App\Models\Transaction::class, function(Faker\Generator $faker) { |
|
12 | 12 | return [ |
13 | - 'user_id' => function () { |
|
13 | + 'user_id' => function() { |
|
14 | 14 | return factory(App\Models\User::class)->create()->id; |
15 | 15 | }, |
16 | - 'status_id' => function () { |
|
16 | + 'status_id' => function() { |
|
17 | 17 | return factory(App\Models\TransactionStatus::class)->create()->id; |
18 | 18 | }, |
19 | - 'type_id' => function () { |
|
19 | + 'type_id' => function() { |
|
20 | 20 | return factory(App\Models\TransactionType::class)->create()->id; |
21 | 21 | }, |
22 | 22 | 'transaction_date' => $faker->dateTimeBetween('-2 years'), |
@@ -8,10 +8,10 @@ |
||
8 | 8 | * |
9 | 9 | * @version 1.0 |
10 | 10 | */ |
11 | -$factory->define(App\Models\Payee::class, function (Faker\Generator $faker) { |
|
11 | +$factory->define(App\Models\Payee::class, function(Faker\Generator $faker) { |
|
12 | 12 | return [ |
13 | 13 | 'name' => $faker->name, |
14 | - 'user_id' => function () { |
|
14 | + 'user_id' => function() { |
|
15 | 15 | return factory(App\Models\User::class)->create()->id; |
16 | 16 | }, |
17 | 17 | ]; |
@@ -18,22 +18,22 @@ |
||
18 | 18 | Route::group([ |
19 | 19 | 'prefix' => 'api/v1', |
20 | 20 | 'middleware' => ['auth:api'], |
21 | -], function () { |
|
22 | - Route::get('/user', function (Request $request) { |
|
21 | +], function() { |
|
22 | + Route::get('/user', function(Request $request) { |
|
23 | 23 | return $request->user(); |
24 | 24 | }); |
25 | 25 | |
26 | - Route::group(['prefix' => 'transactions'], function () { |
|
26 | + Route::group(['prefix' => 'transactions'], function() { |
|
27 | 27 | Route::get('', 'TransactionController@index'); |
28 | 28 | Route::post('', 'TransactionController@store'); |
29 | 29 | }); |
30 | 30 | |
31 | - Route::group(['prefix' => 'category'], function () { |
|
31 | + Route::group(['prefix' => 'category'], function() { |
|
32 | 32 | Route::get('{category}/subcategories', 'CategoryController@subCategories'); |
33 | 33 | Route::get('', 'CategoryController@index'); |
34 | 34 | }); |
35 | 35 | |
36 | - Route::group(['prefix' => 'payee'], function () { |
|
36 | + Route::group(['prefix' => 'payee'], function() { |
|
37 | 37 | Route::get('', 'PayeeController@index'); |
38 | 38 | Route::post('', 'PayeeController@store'); |
39 | 39 | }); |