git add .

git commit "feat: implement activity logging for tours and flights"
This commit is contained in:
2026-08-19 14:59:26 +03:30
parent 7cf68cc02f
commit 4d8839e802
9 changed files with 326 additions and 3 deletions
+26 -1
View File
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Http\Requests\TourStoreRequest;
use App\Models\ActivityLog;
use App\Models\Tour;
use App\Models\TravelType;
use Illuminate\Http\Request;
@@ -50,7 +51,15 @@ class TourController extends Controller
$data['created_by'] = auth('admin')->id();
Tour::create($data);
$tour = Tour::create($data);
ActivityLog::create([
'admin_id' => auth('admin')->id(),
'action' => 'create',
'model' => 'Tour',
'model_id' => $tour->id,
'description' => 'ثبت تور جدید',
]);
DB::commit();
@@ -109,6 +118,14 @@ class TourController extends Controller
$tour->update($data);
ActivityLog::create([
'admin_id' => auth('admin')->id(),
'action' => 'create',
'model' => 'Tour',
'model_id' => $tour->id,
'description' => 'ویرایش تور',
]);
DB::commit();
@@ -138,6 +155,14 @@ class TourController extends Controller
}
ActivityLog::create([
'admin_id' => auth('admin')->id(),
'action' => 'create',
'model' => 'Tour',
'model_id' => $tour->id,
'description' => 'حذف تور',
]);
$tour->delete();