firstcommit
This commit is contained in:
0
Modules/Blog/resources/views/.gitkeep
Normal file
0
Modules/Blog/resources/views/.gitkeep
Normal file
38
Modules/Blog/resources/views/create.blade.php
Normal file
38
Modules/Blog/resources/views/create.blade.php
Normal file
@@ -0,0 +1,38 @@
|
||||
@extends('admin::layouts.master')
|
||||
|
||||
@section('title')
|
||||
Create Blog
|
||||
@endsection
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbData = [
|
||||
[
|
||||
'title' => 'Blog',
|
||||
'link' => 'null',
|
||||
],
|
||||
[
|
||||
'title' => 'Dashboard',
|
||||
'link' => route('dashboard'),
|
||||
],
|
||||
[
|
||||
'title' => 'Blogs',
|
||||
'link' => null,
|
||||
],
|
||||
[
|
||||
'title' => 'Add Blog',
|
||||
'link' => null,
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
@include('admin::layouts.partials.breadcrumb', $breadcrumbData)
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
|
||||
<form action="{{ route('cms.blogs.store') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@include('blog::partial.form')
|
||||
</form>
|
||||
|
||||
@endsection
|
43
Modules/Blog/resources/views/edit.blade.php
Normal file
43
Modules/Blog/resources/views/edit.blade.php
Normal file
@@ -0,0 +1,43 @@
|
||||
@extends('admin::layouts.master')
|
||||
|
||||
@section('title')
|
||||
Update Blog
|
||||
@endsection
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbData = [
|
||||
[
|
||||
'title' => 'Blog',
|
||||
'link' => 'null',
|
||||
],
|
||||
[
|
||||
'title' => 'Dashboard',
|
||||
'link' => route('dashboard'),
|
||||
],
|
||||
[
|
||||
'title' => 'Blogs',
|
||||
'link' => null,
|
||||
],
|
||||
[
|
||||
'title' => 'Update Blog',
|
||||
'link' => null,
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
@include('admin::layouts.partials.breadcrumb', $breadcrumbData)
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card-body">
|
||||
<form action="{{ route('cms.blogs.update', ['uuid' => $blog->uuid]) }}" method="POST"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
@include('blog::partial.form')
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@endsection
|
138
Modules/Blog/resources/views/index.blade.php
Normal file
138
Modules/Blog/resources/views/index.blade.php
Normal file
@@ -0,0 +1,138 @@
|
||||
@extends('admin::layouts.master')
|
||||
|
||||
@section('title')
|
||||
Blog
|
||||
@endsection
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbData = [
|
||||
[
|
||||
'title' => 'Blog',
|
||||
'link' => 'null',
|
||||
],
|
||||
[
|
||||
'title' => 'Dashboard',
|
||||
'link' => route('dashboard'),
|
||||
],
|
||||
[
|
||||
'title' => 'Blogs',
|
||||
'link' => null,
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
@include('admin::layouts.partials.breadcrumb', $breadcrumbData)
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h4 class="card-header">List of Blog</h4>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="flex-column flex-md-row">
|
||||
<div class="dt-action-buttons text-end pt-3 px-3">
|
||||
<div class="dt-buttons btn-group flex-wrap">
|
||||
<a href="{{ route('cms.blogs.create') }}"
|
||||
class="btn btn-secondary create-new btn-primary d-none d-sm-inline-block text-white">
|
||||
<i class="bx bx-plus me-sm-1"></i>
|
||||
Add New
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-datatable table-responsive">
|
||||
<table class="datatables-users table border-top">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>S.N</th>
|
||||
<th>Title With Image</th>
|
||||
<th>Author</th>
|
||||
<th>Published Date</th>
|
||||
<th>Status</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="table-border-bottom-0">
|
||||
@if (count($blogs) > 0)
|
||||
@foreach ($blogs ?? [] as $blog)
|
||||
<tr>
|
||||
<td>
|
||||
#{{ $loop->iteration }}
|
||||
</td>
|
||||
<td>
|
||||
<div class="d-flex align-items-center me-3">
|
||||
<img src="{{ asset($blog->image_path ? 'storage/uploads/' . $blog->image_path : 'backend/uploads/images/no-Image.jpg') }}"
|
||||
alt="Image" class="rounded me-3" height="40" width="60"
|
||||
style="object-fit: cover">
|
||||
<div class="card-title mb-0 px-3">
|
||||
<h6 class="mb-0">{{ $blog->title }}</h6>
|
||||
<small class="text-muted">{{ Str::limit($blog->summary, 80) }}</small>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ $blog->author }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $blog->published_date->toFormattedDateString() }}
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge bg-label-{{ $blog->status == 'active' ? 'success' : 'danger' }}">
|
||||
{{ $blog->status }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn p-0 dropdown-toggle hide-arrow"
|
||||
data-bs-toggle="dropdown">
|
||||
<i class="bx bx-dots-vertical-rounded"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item"
|
||||
href="{{ route('cms.blogs.edit', ['uuid' => $blog->uuid]) }}"><i
|
||||
class="bx bx-edit-alt me-1"></i>
|
||||
Edit</a>
|
||||
|
||||
|
||||
<form method="POST"
|
||||
action="{{ route('cms.blogs.delete', ['uuid' => $blog->uuid]) }}"
|
||||
id="deleteForm_{{ $blog->uuid }}" class="dropdown-item">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="border-0 bg-transparent deleteBtn"
|
||||
style="color:inherit"><i class="bx bx-trash me-1"></i> Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="6">No record found.</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="px-3">
|
||||
{{ $blogs->links('admin::layouts.partials.pagination') }}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
{{-- style --}}
|
||||
@push('required-styles')
|
||||
@include('admin::vendor.dataTables.style')
|
||||
@endpush
|
||||
|
||||
{{-- script --}}
|
||||
@push('required-scripts')
|
||||
@include('admin::vendor.dataTables.script')
|
||||
@endpush
|
29
Modules/Blog/resources/views/layouts/master.blade.php
Normal file
29
Modules/Blog/resources/views/layouts/master.blade.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
||||
<title>Blog Module - {{ config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<meta name="description" content="{{ $description ?? '' }}">
|
||||
<meta name="keywords" content="{{ $keywords ?? '' }}">
|
||||
<meta name="author" content="{{ $author ?? '' }}">
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.bunny.net">
|
||||
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
||||
|
||||
{{-- Vite CSS --}}
|
||||
{{-- {{ module_vite('build-blog', 'resources/assets/sass/app.scss') }} --}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@yield('content')
|
||||
|
||||
{{-- Vite JS --}}
|
||||
{{-- {{ module_vite('build-blog', 'resources/assets/js/app.js') }} --}}
|
||||
</body>
|
@@ -0,0 +1,43 @@
|
||||
<div class="flex items-center justify-between border-t border-gray-200 bg-white px-4 py-3 sm:px-6">
|
||||
<div class="flex flex-1 justify-between sm:hidden">
|
||||
<a href="#" class="relative inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50">Previous</a>
|
||||
<a href="#" class="relative ml-3 inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50">Next</a>
|
||||
</div>
|
||||
<div class="hidden sm:flex sm:flex-1 sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<p class="text-sm text-gray-700">
|
||||
Showing
|
||||
<span class="font-medium">1</span>
|
||||
to
|
||||
<span class="font-medium">10</span>
|
||||
of
|
||||
<span class="font-medium">97</span>
|
||||
results
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<nav class="isolate inline-flex -space-x-px rounded-md shadow-sm" aria-label="Pagination">
|
||||
<a href="#" class="relative inline-flex items-center rounded-l-md px-2 py-2 text-gray-400 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:z-20 focus:outline-offset-0">
|
||||
<span class="sr-only">Previous</span>
|
||||
<svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
<path fill-rule="evenodd" d="M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</a>
|
||||
<!-- Current: "z-10 bg-indigo-600 text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600", Default: "text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:outline-offset-0" -->
|
||||
<a href="#" aria-current="page" class="relative z-10 inline-flex items-center bg-indigo-600 px-4 py-2 text-sm font-semibold text-white focus:z-20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">1</a>
|
||||
<a href="#" class="relative inline-flex items-center px-4 py-2 text-sm font-semibold text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:z-20 focus:outline-offset-0">2</a>
|
||||
<a href="#" class="relative hidden items-center px-4 py-2 text-sm font-semibold text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:z-20 focus:outline-offset-0 md:inline-flex">3</a>
|
||||
<span class="relative inline-flex items-center px-4 py-2 text-sm font-semibold text-gray-700 ring-1 ring-inset ring-gray-300 focus:outline-offset-0">...</span>
|
||||
<a href="#" class="relative hidden items-center px-4 py-2 text-sm font-semibold text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:z-20 focus:outline-offset-0 md:inline-flex">8</a>
|
||||
<a href="#" class="relative inline-flex items-center px-4 py-2 text-sm font-semibold text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:z-20 focus:outline-offset-0">9</a>
|
||||
<a href="#" class="relative inline-flex items-center px-4 py-2 text-sm font-semibold text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:z-20 focus:outline-offset-0">10</a>
|
||||
<a href="#" class="relative inline-flex items-center rounded-r-md px-2 py-2 text-gray-400 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:z-20 focus:outline-offset-0">
|
||||
<span class="sr-only">Next</span>
|
||||
<svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
<path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
132
Modules/Blog/resources/views/partial/form.blade.php
Normal file
132
Modules/Blog/resources/views/partial/form.blade.php
Normal file
@@ -0,0 +1,132 @@
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">Blog Details</h5>
|
||||
<hr class="my-0">
|
||||
<div class="card-body">
|
||||
<div class="row" x-data="generateSlug()" x-init="title = '{{ addslashes(old('title', $blog->title ?? '')) }}'; slug = '{{ addslashes(old('slug', $blog->slug ?? '')) }}'">
|
||||
<div class="mb-3 fv-plugins-icon-container">
|
||||
<label class="form-label" for="basic-default-name">Title</label>
|
||||
<input type="text" class="form-control" x-model="title" x-on:input="updateSlug()" name="title"
|
||||
value="{{ old('title', $blog->title ?? '') }}"
|
||||
placeholder="e.g. The Ultimate Italy Road Trip: 2 Weeks Itinerary (with Amalfi Coast)"
|
||||
required />
|
||||
</div>
|
||||
<div class="mb-3 col-md-6 fv-plugins-icon-container">
|
||||
<label for="slug" class="form-label">Slug</label>
|
||||
<input class="form-control" type="text" x-model="slug" name="slug" id=""
|
||||
value="{{ old('slug', $blog->slug ?? '') }}" placeholder="e.g:blog slug" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3 col-md-6 fv-plugins-icon-container">
|
||||
<label class="form-label" for="basic-default-company">Author</label>
|
||||
<input type="text" class="form-control" name="author"
|
||||
value="{{ old('author', $blog->author ?? '') }}" placeholder="e.g. Jhigu CMS Travel & Tour"
|
||||
required />
|
||||
</div>
|
||||
|
||||
<div class="mb-3 col-md-12">
|
||||
<label for="exampleFormControlTextarea1" class="form-label">Summary</label>
|
||||
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3" name="summary"
|
||||
placeholder="e.g:Write Summary here..." required>{{ old('summary', $blog->summary ?? '') }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="mb-3 col-md-12">
|
||||
<label class="form-label" for="basic-default-message">Content</label><br>
|
||||
<textarea name="content" id="advance" placeholder="Description..">{{ !empty($blog) ? $blog->content : '' }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="mb-3 col-md-6">
|
||||
<label class="form-label" for="basic-default-company">Published Date</label>
|
||||
<input class="date form-control" type="text" id="flatpickr-datetime" name="published_date"
|
||||
value="{{ old('published_date', $blog->published_date ?? '') }}"
|
||||
placeholder="e.g. 2023-11-25 05:21:42" required />
|
||||
</div>
|
||||
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="language" class="form-label">Status</label>
|
||||
<div class="position-relative">
|
||||
<select id="language select2Basic" class="select2 form-select select2-hidden-accessible"
|
||||
data-select2-id="language" tabindex="-1" aria-hidden="true" name="status" required>
|
||||
<option value="" data-select2-id="4">Select Status</option>
|
||||
<option value="active"
|
||||
{{ old('status', $blog->status ?? '') == 'active' ? 'selected' : '' }}>
|
||||
Active</option>
|
||||
<option value="inactive"
|
||||
{{ old('status', $blog->status ?? '') == 'inactive' ? 'selected' : '' }}>Inactive
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-2">
|
||||
<button type="submit" class="btn btn-primary me-2">
|
||||
{{ !isset($blog) ? 'Save Changes' : 'Update Changes' }}</button>
|
||||
<button type="reset" class="btn btn-label-secondary">Reset</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Account -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{-- Right sidebar --}}
|
||||
<div class="col-4">
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">Images</h5>
|
||||
<div class="card-body">
|
||||
<div class="d-flex align-items-start align-items-sm-center gap-4">
|
||||
<img src="{{ asset(!empty($blog->image_path) ? 'storage/uploads/' . $blog->image_path : 'backend/uploads/images/no-Image.jpg') }}"
|
||||
alt="blog-image input-file" class="d-block rounded show-image" height="100" width="100" />
|
||||
<div class="button-wrapper">
|
||||
<label for="upload" class="btn btn-primary me-2 mb-4" tabindex="0">
|
||||
<span class="d-none d-sm-block">Upload</span>
|
||||
<i class="bx bx-upload d-block d-sm-none"></i>
|
||||
<input type="file" id="upload" class="input-file" name="image" hidden
|
||||
accept="image/png, image/jpeg" />
|
||||
</label>
|
||||
<button type="button" class="btn btn-label-secondary image-reset mb-4">
|
||||
<i class="bx bx-reset d-block d-sm-none"></i>
|
||||
<span class="d-none d-sm-block">Reset</span>
|
||||
</button>
|
||||
|
||||
<p class="mb-0">Allowed JPG, GIF or PNG. Max size of 3Mb</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">Blog Meta Details</h5>
|
||||
<div class="card-body">
|
||||
<div class="mb-3 col-md-12">
|
||||
<label for="exampleFormControlTextarea1" class="form-label">Meta Title</label>
|
||||
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3" name="meta_title">{{ old('meta_title', $blog->blogMeta->meta_title ?? '') }}</textarea>
|
||||
</div>
|
||||
<div class="mb-3 col-md-12">
|
||||
<label for="exampleFormControlTextarea1" class="form-label">Meta Description</label>
|
||||
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3" name="meta_description">{{ old('meta_description', $blog->blogMeta->meta_description ?? '') }}</textarea>
|
||||
</div>
|
||||
<div class="mb-3 col-md-12">
|
||||
<label for="exampleFormControlTextarea1" class="form-label">Meta Keywords</label>
|
||||
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3" name="meta_keywords">{{ old('meta_keywords', $blog->blogMeta->meta_keywords ?? '') }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{{-- style --}}
|
||||
@push('required-styles')
|
||||
@include('admin::vendor.datePicker.style')
|
||||
@include('admin::vendor.select2.style')
|
||||
@endpush
|
||||
|
||||
{{-- script --}}
|
||||
@push('required-scripts')
|
||||
@include('admin::vendor.tinymce.script')
|
||||
@include('admin::vendor.imageUpload.script')
|
||||
@include('admin::vendor.datePicker.script')
|
||||
@include('admin::vendor.select2.script')
|
||||
@endpush
|
Reference in New Issue
Block a user