mirror of
https://github.com/HtetPhone/MangaDex.git
synced 2025-02-20 11:23:19 +08:00
responsive design
This commit is contained in:
parent
00b3181a32
commit
8ec4e6f0e6
@ -1,36 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use App\Models\Manga;
|
|
||||||
use App\Models\User;
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
|
|
||||||
class HomeController extends Controller
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Create a new controller instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
$this->middleware(['auth', 'admin.access']);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the application dashboard.
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Contracts\Support\Renderable
|
|
||||||
*/
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
$authors = User::where('role', 'author')->get();
|
|
||||||
$users = User::where('role', 'user')->get();
|
|
||||||
$mangas = Manga::all();
|
|
||||||
// dd($authors);
|
|
||||||
return view('home', ['authors' => $authors, 'users'=> $users, 'mangas' => $mangas]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -26,8 +26,7 @@ class MangaChapterController extends Controller
|
|||||||
public function manga(Manga $manga)
|
public function manga(Manga $manga)
|
||||||
{
|
{
|
||||||
$chapters = $manga->chapters()
|
$chapters = $manga->chapters()
|
||||||
->latest('chapter_no')
|
->paginate(40);
|
||||||
->paginate(10);
|
|
||||||
$hotMangas = Manga::with(['chapters'])
|
$hotMangas = Manga::with(['chapters'])
|
||||||
->latest('id')->limit('3')->get();
|
->latest('id')->limit('3')->get();
|
||||||
return view('manga',[
|
return view('manga',[
|
||||||
|
@ -18,13 +18,10 @@ class MangaController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$mangas = Manga::when(auth()->user()->role != 'admin', function ($q) {
|
$mangas = Manga::latest('id')
|
||||||
$user_id = auth()->id();
|
->paginate(20)
|
||||||
$q->where('author_id', $user_id);
|
->withQueryString();
|
||||||
})
|
// dd($mangas);
|
||||||
->latest('id')
|
|
||||||
->paginate(10)
|
|
||||||
->withQueryString();
|
|
||||||
return view('manga.index', compact('mangas'));
|
return view('manga.index', compact('mangas'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use App\Models\Manga;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class PageController extends Controller
|
class PageController extends Controller
|
||||||
@ -9,7 +11,7 @@ class PageController extends Controller
|
|||||||
public function redirect() {
|
public function redirect() {
|
||||||
$role = auth()->user()->role;
|
$role = auth()->user()->role;
|
||||||
if($role != 'user') {
|
if($role != 'user') {
|
||||||
return redirect()->route('home')->with(['message' => 'Welcome to Admin Dashboard!']);
|
return redirect()->route('dashboard')->with(['message' => 'Welcome to Admin Dashboard!']);
|
||||||
}else {
|
}else {
|
||||||
return redirect()->route('page.index')->with(['message' => 'Welcome to MangaDex!']);
|
return redirect()->route('page.index')->with(['message' => 'Welcome to MangaDex!']);
|
||||||
}
|
}
|
||||||
@ -18,4 +20,19 @@ class PageController extends Controller
|
|||||||
{
|
{
|
||||||
return view('contact');
|
return view('contact');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function dashboard()
|
||||||
|
{
|
||||||
|
$authors = User::where('role', 'author')->get();
|
||||||
|
$users = User::where('role', 'user')->get();
|
||||||
|
$mangas = Manga::all();
|
||||||
|
return view('dashboard',
|
||||||
|
[
|
||||||
|
'authors' => $authors,
|
||||||
|
'users'=> $users,
|
||||||
|
'mangas' => $mangas,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -22,4 +22,8 @@ class Chapter extends Model
|
|||||||
public function comments() {
|
public function comments() {
|
||||||
return $this->hasMany(Comment::class, 'chapter_id');
|
return $this->hasMany(Comment::class, 'chapter_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function user() {
|
||||||
|
return $this->belongsTo(User::class, 'user_id');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ class Manga extends Model
|
|||||||
// {
|
// {
|
||||||
// return $this->chapters()->one()->latestOfMany();
|
// return $this->chapters()->one()->latestOfMany();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
public function lastChap()
|
public function lastChap()
|
||||||
{
|
{
|
||||||
return $this->chapters()->one()->ofMany('chapter_no', 'max');
|
return $this->chapters()->one()->ofMany('chapter_no', 'max');
|
||||||
|
@ -45,7 +45,7 @@ class ChapterPolicy
|
|||||||
*/
|
*/
|
||||||
public function update(User $user, Chapter $chapter): bool
|
public function update(User $user, Chapter $chapter): bool
|
||||||
{
|
{
|
||||||
//
|
return $chapter->user()->is($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -53,7 +53,7 @@ class ChapterPolicy
|
|||||||
*/
|
*/
|
||||||
public function delete(User $user, Chapter $chapter): bool
|
public function delete(User $user, Chapter $chapter): bool
|
||||||
{
|
{
|
||||||
return $user->id == $chapter->user_id;
|
return $this->update($user, $chapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,7 +47,7 @@ class CommentPolicy
|
|||||||
*/
|
*/
|
||||||
public function update(User $user, Comment $comment): bool
|
public function update(User $user, Comment $comment): bool
|
||||||
{
|
{
|
||||||
return $comment->user_id === $user->id;
|
return $comment->user()->is($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -55,7 +55,7 @@ class CommentPolicy
|
|||||||
*/
|
*/
|
||||||
public function delete(User $user, Comment $comment): bool
|
public function delete(User $user, Comment $comment): bool
|
||||||
{
|
{
|
||||||
return $comment->user_id === $user->id || $user->role === 'admin';
|
return $this->update($user, $comment) || $user->role === 'admin';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,7 +23,7 @@ class MangaPolicy
|
|||||||
|
|
||||||
public function viewAny(User $user, Manga $manga): bool
|
public function viewAny(User $user, Manga $manga): bool
|
||||||
{
|
{
|
||||||
// return $user->id == $manga->author_id;
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -31,7 +31,7 @@ class MangaPolicy
|
|||||||
*/
|
*/
|
||||||
public function view(User $user, Manga $manga): bool
|
public function view(User $user, Manga $manga): bool
|
||||||
{
|
{
|
||||||
return $user->id == $manga->author_id;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,7 +47,7 @@ class MangaPolicy
|
|||||||
*/
|
*/
|
||||||
public function update(User $user, Manga $manga): bool
|
public function update(User $user, Manga $manga): bool
|
||||||
{
|
{
|
||||||
return $user->id == $manga->author_id;
|
return $manga->user()->is($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -55,7 +55,7 @@ class MangaPolicy
|
|||||||
*/
|
*/
|
||||||
public function delete(User $user, Manga $manga): bool
|
public function delete(User $user, Manga $manga): bool
|
||||||
{
|
{
|
||||||
return $user->id == $manga->author_id;
|
return $this->update($user, $manga);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
import './bootstrap';
|
import './bootstrap';
|
||||||
|
|
||||||
// let selectChapter = document.querySelector('#selectChapter');
|
|
||||||
// selectChapter.addEventListener('change', function() {
|
|
||||||
// this.submit();
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
import "./edit-box";
|
import "./edit-box";
|
||||||
import "./reply-box";
|
import "./reply-box";
|
||||||
|
|
||||||
|
|
||||||
|
11
resources/js/side-bar.js
Normal file
11
resources/js/side-bar.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
const sideBar = document.getElementById('sideBar')
|
||||||
|
const sideBarBtn = document.getElementById('sideBarBtn')
|
||||||
|
|
||||||
|
sideBarBtn.addEventListener('click', () => {
|
||||||
|
sideBar.classList.toggle('d-none')
|
||||||
|
if(sideBar.classList.contains('d-none')) {
|
||||||
|
sideBarBtn.innerHTML = `<i class="bi bi-list h5"></i>`
|
||||||
|
}else {
|
||||||
|
sideBarBtn.innerHTML = `<i class="bi bi-x h5"></i>`
|
||||||
|
}
|
||||||
|
})
|
@ -8,21 +8,21 @@
|
|||||||
<h3> {{ $manga->title }} </h3>
|
<h3> {{ $manga->title }} </h3>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="d-flex mb-4">
|
<div class="d-flex mb-4">
|
||||||
<h5> Manage Your Chapters </h5> <a href="{{route('chapter.create',['manga_id' => $manga->id])}}" title="Add New Chapter" class="btn btn-sm btn-outline-dark ms-2 rounded-circle"> <i class="bi bi-plus"></i> </a>
|
<h5> Manage Your Chapters </h5> <a href="{{ route('chapter.create', ['manga_id' => $manga->id]) }}"
|
||||||
|
title="Add New Chapter" class="btn btn-sm btn-outline-dark ms-2 rounded-circle"> <i class="bi bi-plus"></i> </a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="d-flex">
|
||||||
@foreach ($manga->chapters()->orderBy('chapter_no', 'desc')->paginate(20) as $chapter)
|
@foreach ($manga->chapters()->orderBy('chapter_no', 'desc')->paginate(20) as $chapter)
|
||||||
<div class="col-2">
|
<div class="d-flex p-2 border border-1 border-dark rounded align-items-center justify-content-between mb-3 me-2">
|
||||||
<div class="d-flex p-2 border border-1 border-dark rounded align-items-center justify-content-between mb-3">
|
<p class="small mb-0"> Chapter {{ $chapter->chapter_no }} </p>
|
||||||
<p class="small mb-0"> Chapter {{ $chapter->chapter_no }} </p>
|
<div class="btn-group ms-2">
|
||||||
<div class="btn-group">
|
<form method="POST" action="{{ route('chapter.destroy', $chapter->id) }}">
|
||||||
<form method="POST" action="{{ route('chapter.destroy', $chapter->id) }}">
|
@csrf
|
||||||
@csrf
|
@method('delete')
|
||||||
@method('delete')
|
<button onclick="return confirm('Do you want to delete this?')" class="btn btn-outline-dark btn-sm">
|
||||||
<button onclick="return confirm('Do you want to delete this?')" class="btn btn-outline-dark btn-sm"> <i class="bi bi-trash"></i> </button>
|
<i class="bi bi-trash"></i> </button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<div class="bg-dark py-5 mt-5">
|
<div class="bg-dark py-4 mt-auto">
|
||||||
<p class="text-center fw-bold text-white">Copyright All Served @MangaDex</p>
|
<p class="text-center fw-bold text-white">Copyright All Served @MangaDex</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
@props(['manga', 'chapters'])
|
@props(['manga', 'chapters'])
|
||||||
<div>
|
<div class="mb-3 pb-4">
|
||||||
<h5 class="fw-semibold my-3 text-primary"> <i class="bi bi-award-fill"></i> {{ $manga->title }}</h5>
|
<h5 class="fw-semibold my-3 text-primary"> <i class="bi bi-award-fill"></i> {{ $manga->title }}</h5>
|
||||||
|
|
||||||
<div class="row my-3">
|
<div class="row my-3">
|
||||||
@ -13,12 +13,13 @@
|
|||||||
<p>
|
<p>
|
||||||
<span class="fw-semibold">Genre</span> -
|
<span class="fw-semibold">Genre</span> -
|
||||||
@foreach ($manga->genres as $genre)
|
@foreach ($manga->genres as $genre)
|
||||||
<span class="text-primary"> {{$genre->name}} </span> /
|
<span class="text-primary"> {{ $genre->name }} </span> /
|
||||||
@endforeach
|
@endforeach
|
||||||
</p>
|
</p>
|
||||||
<p class="d-flex">
|
<p class="d-flex">
|
||||||
<a href="{{ route('page.chapter', [$manga, $manga->firstChap]) }}" class="btn btn-primary me-1">Read First</a>
|
<a href="{{ route('page.chapter', [$manga, $manga->firstChap]) }}" class="btn btn-primary me-1">Read
|
||||||
<a href="{{ route('page.chapter', [$manga, $manga->lastChap]) }}" class="btn btn-primary">Read Last</a>
|
First</a>
|
||||||
|
<a href="{{ route('page.chapter', [$manga, $manga->lastChap]) }}" class="btn btn-primary">Read Last</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -34,18 +35,30 @@
|
|||||||
<i class="bi bi-award-fill"></i> Latest Chapter Release
|
<i class="bi bi-award-fill"></i> Latest Chapter Release
|
||||||
</h5>
|
</h5>
|
||||||
|
|
||||||
@forelse ($chapters as $chapter)
|
<div class="row flex-row px-3">
|
||||||
<a href="{{ route('page.chapter', [$manga, $chapter]) }}"
|
@forelse ($chapters as $chapter)
|
||||||
class="list-group-item list-group-item-action pb-0 border-0 border-bottom
|
<div class="card px-3 pt-2 col-5 col-md-3 my-3 me-4">
|
||||||
d-inline-block d-flex align-items-center justify-content-between">
|
<a href="{{ route('page.chapter', [$manga, $chapter]) }}" class="text-decoration-none text-black">
|
||||||
<p> Chapter {{ $chapter->chapter_no }} - {{ $chapter->title ?? '' }} </p>
|
<p class="mb-1">
|
||||||
<p class="text-black-50 small">
|
<span class="fw-semibold text-primary">
|
||||||
{{ $chapter->updated_at->diffForHumans() }}
|
Chapter {{ $chapter->chapter_no }}
|
||||||
</p>
|
</span>
|
||||||
</a>
|
<span class="ms-2 small text-secondary fst-italic">
|
||||||
@empty
|
{{ $chapter->updated_at->diffForHumans() }}
|
||||||
<p class="text-danger">No Chapter Yet!</p>
|
</span>
|
||||||
@endforelse
|
</p>
|
||||||
|
<p class="small">
|
||||||
|
<span>
|
||||||
|
{{ $chapter->title ?? $chapter->title }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
@empty
|
||||||
|
<p class="text-danger">No Chapter Yet!</p>
|
||||||
|
@endforelse
|
||||||
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
{{ $chapters->links() }}
|
{{ $chapters->links() }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -18,9 +18,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@forelse ($mangas as $manga)
|
@forelse ($mangas as $key => $manga)
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row"> {{ $manga->id }} </th>
|
<th scope="row"> {{ $key + 1 }} </th>
|
||||||
<td>
|
<td>
|
||||||
<p class="mb-0">{{ $manga->title }}</p>
|
<p class="mb-0">{{ $manga->title }}</p>
|
||||||
<span class="small text-black-50">{{ $manga->excerpt }}</span>
|
<span class="small text-black-50">{{ $manga->excerpt }}</span>
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
<link href="https://fonts.bunny.net/css?family=Nunito" rel="stylesheet">
|
<link href="https://fonts.bunny.net/css?family=Nunito" rel="stylesheet">
|
||||||
|
|
||||||
<!-- Scripts -->
|
<!-- Scripts -->
|
||||||
@vite(['resources/sass/app.scss', 'resources/js/app.js'])
|
@vite(['resources/sass/app.scss', 'resources/js/app.js', 'resources/js/side-bar.js'])
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body class="min-vh-100 d-flex flex-column">
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
|
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
@ -79,10 +79,11 @@
|
|||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<main class="py-4 row">
|
<main class="py-4 row">
|
||||||
<div class="col-2">
|
<div class="col-12 col-lg-3 d-flex align-items-start">
|
||||||
@include('partials.side-bar')
|
@include('partials.side-bar')
|
||||||
</div>
|
</div>
|
||||||
<div class="col-10">
|
<hr class="d-block d-lg-none my-3">
|
||||||
|
<div class="col-12 col-lg-9 mt-4 mt-lg-0">
|
||||||
@yield('content')
|
@yield('content')
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
||||||
<title>{{ config('app.name', 'MangaDex') }}</title>
|
|
||||||
|
|
||||||
<!-- Css -->
|
|
||||||
@vite(['resources/sass/app.scss', 'resources/js/app.js'])
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
@include('partials.nav')
|
|
||||||
<div class="container">
|
|
||||||
<div class="row">
|
|
||||||
<!-- sidebar Here -->
|
|
||||||
<div class="col-3">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Content Here -->
|
|
||||||
<div class="main col-9">
|
|
||||||
@yield('content')
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
@ -5,11 +5,11 @@
|
|||||||
@include('partials.manga-breadcrum')
|
@include('partials.manga-breadcrum')
|
||||||
|
|
||||||
<div class="row mt-5">
|
<div class="row mt-5">
|
||||||
<div class="col-12 col-md-9">
|
<div class="col-12 col-lg-9">
|
||||||
<x-inner-manga :manga="$manga" :chapters="$chapters" />
|
<x-inner-manga :manga="$manga" :chapters="$chapters" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 col-md-3">
|
<div class="col-12 col-lg-3">
|
||||||
@include('partials.hot-manga')
|
@include('partials.hot-manga')
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -8,42 +8,38 @@
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
|
||||||
{{-- <li class="nav-item">
|
|
||||||
<a class="nav-link" href="{{route('contact')}}">CONTACT US</a>
|
|
||||||
</li> --}}
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
<!-- search box -->
|
<!-- search box -->
|
||||||
<form class="d-flex" role="search" method="GET" action="{{ route('page.index') }}">
|
<form class="d-flex ms-auto" role="search" method="GET" action="{{ route('page.index') }}">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input name="search" class="form-control" type="search" placeholder="Search" aria-label="Search">
|
<input name="search" class="form-control" type="search" placeholder="Search" aria-label="Search">
|
||||||
<button class="btn btn-dark" type="submit"> <i class="bi bi-search"></i> </button>
|
<button class="btn btn-dark" type="submit"> <i class="bi bi-search"></i> </button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--profile and logout -->
|
<!--profile and logout -->
|
||||||
@auth
|
@auth
|
||||||
<div class="btn btn-outline-dark dropdown ms-3">
|
<div class="btn btn-outline-dark dropdown ms-lg-3 mt-3 mt-lg-0">
|
||||||
<a id="navbarDropdown" class="nav-link dropdown-toggle" role="button"
|
<a id="navbarDropdown" class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown"
|
||||||
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
|
aria-haspopup="true" aria-expanded="false" v-pre>
|
||||||
<i class="bi bi-person-circle"></i> {{ Auth::user()->name }}
|
<i class="bi bi-person-circle"></i> {{ Auth::user()->name }}
|
||||||
</a>
|
|
||||||
|
|
||||||
<div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
|
|
||||||
<a class="dropdown-item" href="{{ route('logout') }}"
|
|
||||||
onclick="event.preventDefault();
|
|
||||||
document.getElementById('logout-form').submit();">
|
|
||||||
{{ __('Logout') }}
|
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
|
<div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
|
||||||
@csrf
|
<a class="dropdown-item" href="{{ route('logout') }}"
|
||||||
</form>
|
onclick="event.preventDefault();
|
||||||
|
document.getElementById('logout-form').submit();">
|
||||||
|
{{ __('Logout') }}
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
|
||||||
|
@csrf
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
@endauth
|
||||||
@endauth
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
@auth
|
@auth
|
||||||
@can('dashboard')
|
@can('dashboard')
|
||||||
<a href="{{ route('home') }}" class="btn btn-sm btn-dark rounded-pill"> <i class="bi bi-speedometer"></i> Go To
|
<a href="{{ route('dashboard') }}" class="btn btn-sm btn-dark rounded-pill"> <i class="bi bi-speedometer"></i> Go To
|
||||||
Dashboard</a>
|
Dashboard</a>
|
||||||
@endcan
|
@endcan
|
||||||
@endauth
|
@endauth
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
<ul class="list-group">
|
<ul class="list-group d-none d-lg-block w-75 w-lg-100 me-3" id="sideBar">
|
||||||
<h5>
|
<h5>
|
||||||
<a href="{{ route('home') }}" class="list-group-item list-group-item-action text-primary">
|
<a href="{{ route('dashboard') }}" class="list-group-item list-group-item-action text-primary">
|
||||||
<i class="bi bi-speedometer2"></i> Dashboard
|
<i class="bi bi-speedometer2"></i> Dashboard
|
||||||
</a>
|
</a>
|
||||||
</h5>
|
</h5>
|
||||||
|
|
||||||
<h5>Manga</h5>
|
<h5>Manga</h5>
|
||||||
<a href="{{ route('manga.index') }}" class="list-group-item list-group-item-action">
|
<a href="{{ route('manga.index') }}" class="list-group-item list-group-item-action">
|
||||||
<i class="bi bi-book"></i> Manga List
|
<i class="bi bi-book"></i> Manga List
|
||||||
@ -34,3 +35,7 @@
|
|||||||
</a>
|
</a>
|
||||||
@endcan
|
@endcan
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<button id="sideBarBtn" class="btn btn-outline-dark d-block d-lg-none">
|
||||||
|
<i class="bi bi-list h4"></i>
|
||||||
|
</button>
|
@ -42,17 +42,16 @@ Route::resource('replies', ReplyController::class)->middleware('auth');
|
|||||||
//auth
|
//auth
|
||||||
Auth::routes();
|
Auth::routes();
|
||||||
|
|
||||||
//home
|
|
||||||
Route::get('/home', [HomeController::class, 'index'])
|
|
||||||
->name('home');
|
|
||||||
|
|
||||||
//admin dashboard
|
//admin dashboard
|
||||||
Route::middleware(['auth', 'admin.access'])->group(function () {
|
Route::middleware(['auth', 'admin.access'])->group(function () {
|
||||||
|
Route::get('/dashboard', [PageController::class, 'dashboard'])
|
||||||
|
->name('dashboard');
|
||||||
|
|
||||||
Route::resource('manga', MangaController::class);
|
Route::resource('manga', MangaController::class);
|
||||||
|
|
||||||
Route::resource('chapter', ChapterController::class);
|
Route::resource('chapter', ChapterController::class);
|
||||||
Route::get('/chapters/manage/{manga:slug}', [ChapterController::class, 'manage'])
|
Route::get('/chapters/manage/{manga:slug}', [ChapterController::class, 'manage'])->name('chapters.manage');
|
||||||
->name('chapters.manage');
|
|
||||||
|
|
||||||
Route::get('/users-list', [UserController::class, 'index'])->name('users.list')->middleware('can:admin-only');
|
Route::get('/users-list', [UserController::class, 'index'])->name('users.list')->middleware('can:admin-only');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user