git add .
git commit "fix dashboard charts rendering and views data display"
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Tour;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class TourController extends Controller
|
||||
{
|
||||
@@ -24,6 +25,10 @@ class TourController extends Controller
|
||||
{
|
||||
$tour->load('travelType');
|
||||
$tour->increment('views');
|
||||
|
||||
$cacheKey = 'tour_views:' . $tour->id . ':' . now()->format('Y-m-d');
|
||||
Cache::put($cacheKey, Cache::get($cacheKey, 0) + 1, now()->addDays(15));
|
||||
|
||||
$comments = $tour->comments()
|
||||
->latest()
|
||||
->get();
|
||||
|
||||
Reference in New Issue
Block a user