Skip to content

Commit

Permalink
feat: 17. Dashboard UI
Browse files Browse the repository at this point in the history
  • Loading branch information
mfl4 committed Dec 8, 2023
1 parent 924f20f commit ddcf7cc
Show file tree
Hide file tree
Showing 17 changed files with 480 additions and 168 deletions.
14 changes: 0 additions & 14 deletions app/Http/Controllers/DashboardController.php

This file was deleted.

69 changes: 69 additions & 0 deletions app/Http/Controllers/DashboardPostController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php

namespace App\Http\Controllers;

use App\Models\Post;
use Illuminate\Http\Request;

class DashboardPostController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('dashboard.posts.index', [
'posts' => Post::where('user_id', auth()->user()->id)->get(),
]);
}

/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}

/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}

/**
* Display the specified resource.
*/
public function show(Post $post)
{
return view('dashboard.posts.show', [
'post' => $post,
]);
}

/**
* Show the form for editing the specified resource.
*/
public function edit(Post $post)
{
//
}

/**
* Update the specified resource in storage.
*/
public function update(Request $request, Post $post)
{
//
}

/**
* Remove the specified resource from storage.
*/
public function destroy(Post $post)
{
//
}
}
5 changes: 5 additions & 0 deletions app/Models/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,9 @@ public function scopeFilter($query, array $filters)
)
);
}

public function getRouteKeyName()
{
return 'slug';
}
}
Loading

0 comments on commit ddcf7cc

Please sign in to comment.