Add field for amount to earnings/spendings
MODIFY
database/migrations/2017_07_23_111013_create_spendings_table.php
database/migrations/2017_07_23_111013_create_spendings_table.php
@@ -11,6 +11,7 @@ class CreateSpendingsTable extends Migration {
$table->integer('user_id')->unsigned();
$table->date('date');
$table->string('description');
+ $table->float('amount');
});
}

MODIFY
database/migrations/2017_07_23_112354_create_earnings_table.php
database/migrations/2017_07_23_112354_create_earnings_table.php
@@ -12,6 +12,7 @@ class CreateEarningsTable extends Migration {
$table->integer('user_id')->unsigned();
$table->date('date');
$table->string('description');
+ $table->float('amount');
});
}

MODIFY
public/style.css
public/style.css
@@ -38,6 +38,18 @@ ul.box__section li:first-child {
padding: 0;
}
+table.box__section {
+ width: 100%;
+}
+
+table.box__section tr td {
+ padding: 32px 0 0;
+}
+
+table.box__section tr:first-child td {
+ padding: 0;
+}
+
label, input {
display: block;
}

MODIFY
resources/views/dashboard.blade.php
resources/views/dashboard.blade.php
@section('body')
<h1>Earnings</h1>
<div class="box">
- <ul class="box__section">
+ <table class="box__section">
+ <tbody>
@foreach (Auth::user()->earnings as $earning)
- <li>{{ $earning->description }}</li>
+ <tr>
+ <td>{{ $earning->description }}</td>
+ <td>{{ $earning->amount }}</td>
+ </tr>
@endforeach
- </ul>
+ </tbody>
+ </table>
</div>
<h1>Spendings</h1>
<div class="box">
- <ul class="box__section">
+ <table class="box__section">
+ <tbody>
@foreach (Auth::user()->spendings as $spending)
- <li>{{ $spending->description }}</li>
+ <tr>
+ <td>{{ $spending->description }}</td>
+ <td>{{ $spending->amount }}</td>
+ </tr>
@endforeach
- </ul>
+ </tbody>
+ </table>
</div>
@endsection

Add field for amount to earnings/spendings