aboutsummaryrefslogtreecommitdiff
path: root/app/Http/Controllers/PagesController.php
blob: ac7ababaf56131b7eda22f0bbbd469139585bb87 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use function dd;

use App\Models\Post;
use App\Models\Reservation;

class PagesController extends Controller
{
    public function index(Request $request)
    {
        return view('pages.index');
    }

    public function news(Request $request)
    {
        $news = Post::orderBy('created_at', 'desc')->get();

        //$data = ['news' => $news];
        //return view('pages.news')->with($data);
        //return view('pages.news')->with('news', $news);
        return view('pages.news', compact('news'));
    }

    public function gallery(Request $request)
    {
        return view('pages.gallery');
    }

    public function sponsoring(Request $request)
    {
        return view('pages.sponsoring');
    }

    public function activities(Request $request)
    {
        $activities = Reservation::where('approved', '1')->get();
        //$activities = Reservation::addSelect([
            //'specialCall' => SpecialCall::select('sign')
                ////->whereColumn('reservations.specialCall', 'special_calls.id')
                //->whereColumn('specialCall', 'id')
                //->limit(1)
        //])->get();

        return view('pages.activities', compact('activities'));
    }
}