@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @param TransactionRequest|Request $request |
42 | 42 | * |
43 | - * @return \Illuminate\Http\Response |
|
43 | + * @return \Illuminate\Http\RedirectResponse |
|
44 | 44 | */ |
45 | 45 | public function store(TransactionRequest $request) |
46 | 46 | { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @param TransactionRequest|Request $request |
59 | 59 | * @param int $id |
60 | 60 | * |
61 | - * @return \Illuminate\Http\Response |
|
61 | + * @return \Illuminate\Http\RedirectResponse |
|
62 | 62 | */ |
63 | 63 | public function update(TransactionRequest $request, $id) |
64 | 64 | { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * Updates a existing transaction and touch last used payee and payee's category. |
118 | 118 | * |
119 | 119 | * @param User $user |
120 | - * @param $id |
|
120 | + * @param integer $id |
|
121 | 121 | * @param Collection $data |
122 | 122 | * @param array|null $files |
123 | 123 | * |
@@ -250,6 +250,9 @@ discard block |
||
250 | 250 | } |
251 | 251 | } |
252 | 252 | |
253 | + /** |
|
254 | + * @param Collection $data |
|
255 | + */ |
|
253 | 256 | private function parseTransactionDate($data, $jsonRequest = false) |
254 | 257 | { |
255 | 258 | $date = null; |
@@ -10,9 +10,6 @@ |
||
10 | 10 | |
11 | 11 | namespace App\Services; |
12 | 12 | |
13 | -use App\Models\Account; |
|
14 | -use App\Models\Category; |
|
15 | -use App\Models\Payee; |
|
16 | 13 | use App\Models\Transaction; |
17 | 14 | use App\Models\TransactionStatus; |
18 | 15 | use App\Models\TransactionType; |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::table('payees', function (Blueprint $table) { |
|
16 | + Schema::table('payees', function(Blueprint $table) { |
|
17 | 17 | $table->timestamp('last_used_at')->nullable(); |
18 | 18 | $table->softDeletes(); |
19 | 19 | }); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function down() |
28 | 28 | { |
29 | - Schema::table('payees', function (Blueprint $table) { |
|
29 | + Schema::table('payees', function(Blueprint $table) { |
|
30 | 30 | $table->dropSoftDeletes(); |
31 | 31 | }); |
32 | 32 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::table('categories', function (Blueprint $table) { |
|
16 | + Schema::table('categories', function(Blueprint $table) { |
|
17 | 17 | $table->softDeletes(); |
18 | 18 | }); |
19 | 19 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function down() |
27 | 27 | { |
28 | - Schema::table('categories', function (Blueprint $table) { |
|
28 | + Schema::table('categories', function(Blueprint $table) { |
|
29 | 29 | $table->dropSoftDeletes(); |
30 | 30 | }); |
31 | 31 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::table('transactions', function (Blueprint $table) { |
|
16 | + Schema::table('transactions', function(Blueprint $table) { |
|
17 | 17 | $table->string('payee_name')->nullable()->change(); |
18 | 18 | }); |
19 | 19 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function down() |
27 | 27 | { |
28 | - Schema::table('transactions', function (Blueprint $table) { |
|
28 | + Schema::table('transactions', function(Blueprint $table) { |
|
29 | 29 | $table->string('payee_name')->default('')->change(); |
30 | 30 | }); |
31 | 31 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('categories', function (Blueprint $table) { |
|
16 | + Schema::create('categories', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->integer('user_id')->unsigned(); |
19 | 19 | $table->integer('parent_id')->unsigned()->nullable(); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $table->timestamps(); |
22 | 22 | }); |
23 | 23 | |
24 | - Schema::table('categories', function (Blueprint $table) { |
|
24 | + Schema::table('categories', function(Blueprint $table) { |
|
25 | 25 | $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); |
26 | 26 | $table->foreign('parent_id')->references('id')->on('categories'); |
27 | 27 | }); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function up() |
13 | 13 | { |
14 | - Schema::create('media', function (Blueprint $table) { |
|
14 | + Schema::create('media', function(Blueprint $table) { |
|
15 | 15 | $table->increments('id'); |
16 | 16 | $table->morphs('model'); |
17 | 17 | $table->string('collection_name'); |
@@ -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('use_datepicker')->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('use_datepicker'); |
30 | 30 | }); |
31 | 31 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('payees', function (Blueprint $table) { |
|
16 | + Schema::create('payees', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->integer('user_id')->unsigned(); |
19 | 19 | $table->integer('last_category_id')->unsigned()->nullable(); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $table->timestamps(); |
22 | 22 | }); |
23 | 23 | |
24 | - Schema::table('payees', function (Blueprint $table) { |
|
24 | + Schema::table('payees', function(Blueprint $table) { |
|
25 | 25 | $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); |
26 | 26 | $table->foreign('last_category_id')->references('id')->on('categories'); |
27 | 27 | }); |