A free open source IT asset/license management system
Use translation
Marcus Moore44503fc423d3
diff --git a/app/Http/Controllers/NotesController.php b/app/Http/Controllers/NotesController.phpindex e24436e5ad..a3e7a36b3b 100644--- a/app/Http/Controllers/NotesController.php+++ b/app/Http/Controllers/NotesController.php@@ -2,7 +2,6 @@namespace App\Http\Controllers;-use App\Events\NoteAdded;use App\Models\Actionlog;use App\Models\Asset;use Illuminate\Http\Request;@@ -14,7 +13,6 @@ class NotesController extends Controllerpublic function store(Request $request){$validated = $request->validate([- // @todo: improve?'id' => 'required','note' => 'required|string|max:500','type' => [@@ -27,7 +25,7 @@ class NotesController extends Controller$this->authorize('update', $item);- $logaction = new Actionlog();+ $logaction = new Actionlog;$logaction->item_id = $item->id;$logaction->item_type = get_class($item);$logaction->note = $validated['note'];@@ -38,6 +36,6 @@ class NotesController extends Controller->route('hardware.show', $validated['id'])->withFragment('history')// @todo: translate- ->with('success', 'Note Added!');+ ->with('success', trans('general.note_added'));}}diff --git a/tests/Feature/Notes/CreateNotesTest.php b/tests/Feature/Notes/CreateNotesTest.phpindex 789991adb0..fac13c1ac8 100644--- a/tests/Feature/Notes/CreateNotesTest.php+++ b/tests/Feature/Notes/CreateNotesTest.php@@ -36,7 +36,8 @@ class CreateNotesTest extends TestCase'type' => 'asset','note' => 'my special note',])- ->assertRedirect(route('hardware.show', $asset->id) . '#history');+ ->assertRedirect(route('hardware.show', $asset->id) . '#history')+ ->assertSessionHas('success', trans('general.note_added'));$this->assertDatabaseHas('action_logs', ['created_by' => $actor->id,