git add .
git commit "fix dashboard charts rendering and views data display"
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
|
||||
use App\Models\Flight;
|
||||
use App\Models\Tour;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class FlightController extends Controller
|
||||
{
|
||||
@@ -40,6 +41,9 @@ class FlightController extends Controller
|
||||
{
|
||||
$flight->increment('views');
|
||||
|
||||
$cacheKey = 'flight_views:' . $flight->id . ':' . now()->format('Y-m-d');
|
||||
Cache::put($cacheKey, Cache::get($cacheKey, 0) + 1, now()->addDays(15));
|
||||
|
||||
$comments = $flight->comments()
|
||||
->latest()
|
||||
->get();
|
||||
|
||||
Reference in New Issue
Block a user