Skip to content

Commit

Permalink
Merge pull request #15 from SethSharp/sharpie/dev-264-setup-dynamic-p…
Browse files Browse the repository at this point in the history
…age-renderring

Sharpie/dev 264 setup dynamic page renderring
  • Loading branch information
SethSharp authored Feb 3, 2024
2 parents 2d12f00 + e7edc3a commit 134a214
Show file tree
Hide file tree
Showing 17 changed files with 481 additions and 1,785 deletions.
17 changes: 17 additions & 0 deletions app/Http/Controllers/Views/Blogs/IndexBlogsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace App\Http\Controllers\Views\Blogs;

use Illuminate\View\View;
use App\Domain\Blog\Models\Blog;
use App\Http\Controllers\Controller;

class IndexBlogsController extends Controller
{
public function __invoke(): View
{
return view('blogs.index', [
'blogs' => Blog::all()
]);
}
}
17 changes: 17 additions & 0 deletions app/Http/Controllers/Views/Blogs/ShowBlogController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace App\Http\Controllers\Views\Blogs;

use Illuminate\View\View;
use App\Domain\Blog\Models\Blog;
use App\Http\Controllers\Controller;

class ShowBlogController extends Controller
{
public function __invoke(Blog $blog): View
{
return view('blogs.show', [
'blog' => $blog
]);
}
}
24 changes: 24 additions & 0 deletions app/Http/Livewire/blogs/ShowBlog.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Http\Livewire\blogs;

use Livewire\Component;
use App\Domain\Blog\Models\Blog;

class ShowBlog extends Component
{
public Blog $blog;

public function mount(Blog $blog)
{
$this->blog = $blog;
}

public function render()
{
return view('livewire.blogs.show-blog', [
'blog' => $this->blog
])
->layout('layouts.main');
}
}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"laravel/framework": "^9.19",
"laravel/sanctum": "^3.2",
"laravel/tinker": "^2.7",
"livewire/livewire": "^2.12",
"tightenco/ziggy": "^1.0"
},
"require-dev": {
Expand Down
Loading

0 comments on commit 134a214

Please sign in to comment.