change workshop table to events
This commit is contained in:
@@ -3,18 +3,18 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Post;
|
||||
use App\Models\Workshop;
|
||||
use App\Models\Event;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$posts = Post::query()->orderBy('created_at', 'desc')->limit(4)->get();
|
||||
$workshops = Workshop::query()->where('starts_at', '>', now())->where('status', '!=', 'private')->orderBy('starts_at', 'asc')->limit(4)->get();
|
||||
$events = Event::query()->where('starts_at', '>', now())->where('status', '!=', 'private')->orderBy('starts_at', 'asc')->limit(4)->get();
|
||||
|
||||
return view('home', [
|
||||
'posts' => $posts,
|
||||
'workshops' => $workshops,
|
||||
'events' => $events,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user