Enable soft-deleting for tags
MODIFY
app/Tag.php
app/Tag.php
namespace App;
use Illuminate\Database\Eloquent\Model;
-
+use Illuminate\Database\Eloquent\SoftDeletes;
use App\Spending;
class Tag extends Model {
+ use SoftDeletes;
+
+ protected $dates = ['deleted_at'];
+
public function spendings() {
return $this->hasMany(Spending::class);
}

MODIFY
database/migrations/2017_07_23_184043_create_tags_table.php
database/migrations/2017_07_23_184043_create_tags_table.php
@@ -11,6 +11,7 @@ class CreateTagsTable extends Migration {
$table->integer('user_id')->unsigned();
$table->string('name');
$table->timestamps();
+ $table->softDeletes();
});
}

Enable soft-deleting for tags