Skip to content

Commit

Permalink
#198 - controllers wip
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofrewak committed Jan 29, 2024
1 parent 9c38b3c commit 79348bb
Show file tree
Hide file tree
Showing 11 changed files with 153 additions and 7 deletions.
16 changes: 16 additions & 0 deletions app/Http/Controllers/AboutController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace Blumilk\Website\Http\Controllers;

use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;

class AboutController extends Controller
{
public function __invoke(Factory $factory): View
{
return $factory->make("about");
}
}
16 changes: 16 additions & 0 deletions app/Http/Controllers/CareerController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace Blumilk\Website\Http\Controllers;

use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;

class CareerController extends Controller
{
public function __invoke(Factory $factory): View
{
return $factory->make("career");
}
}
21 changes: 21 additions & 0 deletions app/Http/Controllers/CaseStudiesController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

namespace Blumilk\Website\Http\Controllers;

use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;

class CaseStudiesController extends Controller
{
public function index(Factory $factory): View
{
return $factory->make("case_studies");
}

public function get(Factory $factory, string $slug): View
{
return $factory->make("case_study");
}
}
21 changes: 21 additions & 0 deletions app/Http/Controllers/EventsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

namespace Blumilk\Website\Http\Controllers;

use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;

class EventsController extends Controller
{
public function index(Factory $factory): View
{
return $factory->make("events");
}

public function get(Factory $factory, string $slug): View
{
return $factory->make("event");
}
}
16 changes: 16 additions & 0 deletions app/Http/Controllers/LegalController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace Blumilk\Website\Http\Controllers;

use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;

class LegalController extends Controller
{
public function __invoke(Factory $factory): View
{
return $factory->make("legal");
}
}
16 changes: 16 additions & 0 deletions app/Http/Controllers/MeetupsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace Blumilk\Website\Http\Controllers;

use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;

class MeetupsController extends Controller
{
public function __invoke(Factory $factory): View
{
return $factory->make("meetups");
}
}
16 changes: 16 additions & 0 deletions app/Http/Controllers/PartnersController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace Blumilk\Website\Http\Controllers;

use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;

class PartnersController extends Controller
{
public function __invoke(Factory $factory): View
{
return $factory->make("partners");
}
}
10 changes: 9 additions & 1 deletion lang/pl/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
declare(strict_types=1);

return [
"events/{id}" => "wydarzenia/{id}",
"about" => "o-firmie",
"case-studies" => "case-study",
"case-studies/{slug}" => "case-study/{slug}",
"partners" => "partnerzy",
"career" => "kariera",
"contact" => "kontakt",
"legal" => "prawne",
"meetups" => "meetupy",
"events" => "wydarzenia",
"events/{slug}" => "wydarzenia/{slug}",
];
2 changes: 1 addition & 1 deletion resources/views/contact.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@extends("layout.app")

@section("content")
office@blumik.pl
office@blumilk.pl
@endsection
8 changes: 4 additions & 4 deletions resources/views/layout/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

<div class="p-12 flex justify-center gap-4">
<a href="{{ route("home") }}">{{ __("content.pages.home") }}</a>
<a href="{{ route("home") }}">{{ __("content.pages.about") }}</a>
<a href="{{ route("home") }}">{{ __("content.pages.case_study") }}</a>
<a href="{{ route("home") }}">{{ __("content.pages.partners") }}</a>
<a href="{{ route("home") }}">{{ __("content.pages.career") }}</a>
<a href="{{ route("about") }}">{{ __("content.pages.about") }}</a>
<a href="{{ route("case-studies") }}">{{ __("content.pages.case_study") }}</a>
<a href="{{ route("partners") }}">{{ __("content.pages.partners") }}</a>
<a href="{{ route("career") }}">{{ __("content.pages.career") }}</a>
<a href="{{ route("contact") }}">{{ __("content.pages.contact") }}</a>

<div class="flex-1 flex justify-end gap-4">
Expand Down
18 changes: 17 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

declare(strict_types=1);

use Blumilk\Website\Http\Controllers\AboutController;
use Blumilk\Website\Http\Controllers\CareerController;
use Blumilk\Website\Http\Controllers\CaseStudiesController;
use Blumilk\Website\Http\Controllers\ContactController;
use Blumilk\Website\Http\Controllers\EventsController;
use Blumilk\Website\Http\Controllers\HomeController;
use Blumilk\Website\Http\Controllers\LegalController;
use Blumilk\Website\Http\Controllers\MeetupsController;
use Blumilk\Website\Http\Controllers\PartnersController;
use Illuminate\Routing\Router;
use Illuminate\Translation\Translator;

Expand All @@ -12,5 +19,14 @@
$lang = app(Translator::class);

$router->get("/", HomeController::class)->name("home");
$router->get($lang->uri("about"), AboutController::class)->name("about");
$router->get($lang->uri("case-studies"), [CaseStudiesController::class, "index"])->name("case-studies");
$router->get($lang->uri("case-studies/{slug}"), [CaseStudiesController::class, "get"])->name("case-studies.entry");
$router->get($lang->uri("partners"), PartnersController::class)->name("partners");
$router->get($lang->uri("career"), CareerController::class)->name("career");
$router->get($lang->uri("contact"), ContactController::class)->name("contact");
$router->get($lang->uri("events/{id}"), ContactController::class)->name("event");

$router->get($lang->uri("meetups"), MeetupsController::class)->name("meetups");
$router->get($lang->uri("events"), [EventsController::class, "index"])->name("events");
$router->get($lang->uri("events/{slug}"), [EventsController::class, "get"])->name("event");
$router->get($lang->uri("legal"), LegalController::class)->name("legal");

0 comments on commit 79348bb

Please sign in to comment.