firstcommit
This commit is contained in:
0
Modules/Post/resources/assets/.gitkeep
Normal file
0
Modules/Post/resources/assets/.gitkeep
Normal file
0
Modules/Post/resources/assets/js/app.js
Normal file
0
Modules/Post/resources/assets/js/app.js
Normal file
0
Modules/Post/resources/assets/sass/app.scss
Normal file
0
Modules/Post/resources/assets/sass/app.scss
Normal file
0
Modules/Post/resources/views/.gitkeep
Normal file
0
Modules/Post/resources/views/.gitkeep
Normal file
38
Modules/Post/resources/views/create.blade.php
Normal file
38
Modules/Post/resources/views/create.blade.php
Normal file
@@ -0,0 +1,38 @@
|
||||
@extends('admin::layouts.master')
|
||||
|
||||
@section('title')
|
||||
Create Post
|
||||
@endsection
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbData = [
|
||||
[
|
||||
'title' => 'Create',
|
||||
'link' => 'null',
|
||||
],
|
||||
[
|
||||
'title' => 'Dashboard',
|
||||
'link' => route('dashboard'),
|
||||
],
|
||||
[
|
||||
'title' => 'Posts',
|
||||
'link' => route('post.index'),
|
||||
],
|
||||
[
|
||||
'title' => 'Create',
|
||||
'link' => null,
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
@include('admin::layouts.partials.breadcrumb', $breadcrumbData)
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
|
||||
<form action="{{ route('post.store') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@include('post::partial.form')
|
||||
</form>
|
||||
|
||||
@endsection
|
39
Modules/Post/resources/views/edit.blade.php
Normal file
39
Modules/Post/resources/views/edit.blade.php
Normal file
@@ -0,0 +1,39 @@
|
||||
@extends('admin::layouts.master')
|
||||
|
||||
@section('title')
|
||||
Update Post
|
||||
@endsection
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbData = [
|
||||
[
|
||||
'title' => 'Post',
|
||||
'link' => 'null',
|
||||
],
|
||||
[
|
||||
'title' => 'Dashboard',
|
||||
'link' => route('dashboard'),
|
||||
],
|
||||
[
|
||||
'title' => 'Posts',
|
||||
'link' => route('post.index'),
|
||||
],
|
||||
[
|
||||
'title' => 'Update',
|
||||
'link' => null,
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
@include('admin::layouts.partials.breadcrumb', $breadcrumbData)
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
|
||||
<form action="{{ route('post.update', ['id' => $post->id]) }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('put')
|
||||
@include('post::partial.form', $post)
|
||||
</form>
|
||||
|
||||
@endsection
|
111
Modules/Post/resources/views/index.blade.php
Normal file
111
Modules/Post/resources/views/index.blade.php
Normal file
@@ -0,0 +1,111 @@
|
||||
@extends('admin::layouts.master')
|
||||
|
||||
@section('title')
|
||||
Posts
|
||||
@endsection
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbData = [
|
||||
[
|
||||
'title' => 'Posts',
|
||||
'link' => 'null',
|
||||
],
|
||||
[
|
||||
'title' => 'Dashboard',
|
||||
'link' => route('dashboard'),
|
||||
],
|
||||
[
|
||||
'title' => 'Posts',
|
||||
'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 Post</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('post.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 table-hover border-top">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>S.N</th>
|
||||
<th>Title With Image</th>
|
||||
<th>Page</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-border-bottom-0">
|
||||
@foreach ($posts ?? [] as $post)
|
||||
<tr>
|
||||
<td>
|
||||
#{{ $loop->iteration }}
|
||||
</td>
|
||||
<td>
|
||||
<div class="d-flex align-items-center me-3">
|
||||
<img src="{{ asset($post->fullImage ?? '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">
|
||||
<h6 class="mb-0">{{ $post->title }}</h6>
|
||||
<small class="text-muted">{{ Str::limit($post->short_detail, 80) }}</small>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{{ optional($post->page)->title }}
|
||||
</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('post.edit', ['id' => $post->id]) }}"><i
|
||||
class="bx bx-edit-alt me-1"></i>
|
||||
Edit</a>
|
||||
|
||||
|
||||
<form method="POST"
|
||||
action="{{ route('post.delete', ['id' => $post->id]) }}"
|
||||
id="deleteForm_{{ $post->id }}" 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
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="px-3">
|
||||
{{ $posts->links('admin::layouts.partials.pagination') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
29
Modules/Post/resources/views/layouts/master.blade.php
Normal file
29
Modules/Post/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>Post 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-post', 'resources/assets/sass/app.scss') }} --}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@yield('content')
|
||||
|
||||
{{-- Vite JS --}}
|
||||
{{-- {{ module_vite('build-post', 'resources/assets/js/app.js') }} --}}
|
||||
</body>
|
158
Modules/Post/resources/views/partial/form.blade.php
Normal file
158
Modules/Post/resources/views/partial/form.blade.php
Normal file
@@ -0,0 +1,158 @@
|
||||
@push('required-styles')
|
||||
@include('admin::vendor.select2.style')
|
||||
@endpush
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" x-data="generateSlug()" x-init="title = '{{ addslashes(old('title', $post->title ?? '')) }}';
|
||||
slug = '{{ addslashes(old('slug', $post->slug ?? '')) }}'">
|
||||
<div class="col-12">
|
||||
<h6 class="fw-normal">1. Basic Details</h6>
|
||||
<hr class="mt-0">
|
||||
</div>
|
||||
<div class="col-md-12" x-data="generateSlug()">
|
||||
{{-- <div class="d-flex align-items-start align-items-sm-center gap-4">
|
||||
<img src="{{ isset($post->image) ? $post->fullImage : asset('backend/uploads/images/no-Image.jpg') }}"
|
||||
alt="destination-image input-file" class="d-block rounded show-image" height="100"
|
||||
width="100" />
|
||||
<div class="button-wrapper">
|
||||
<label for="upload" class="btn btn-primary btn-sm 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 btn-sm 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>
|
||||
<hr class="mt-2" /> --}}
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label">Title <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" x-model="title" x-on:input="updateSlug()" name="title"
|
||||
value="{{ old('title', $post->title ?? '') }}" placeholder="e.g. Hair Transplant" required />
|
||||
@error('title')
|
||||
<div class="text-danger">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label class="form-label">Slug <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" x-model="slug" name="slug"
|
||||
value="{{ old('slug', $post->slug ?? '') }}" placeholder="e.g. hair-transplant" required />
|
||||
@error('slug')
|
||||
<div class="text-danger">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="col-md-12 mb-3">
|
||||
<label class="form-label">Short Detail</label>
|
||||
<textarea class="form-control" rows="3" name="short_detail" placeholder="Short detail..">{{ old('short_detail', $post->short_detail ?? '') }}</textarea>
|
||||
@error('short_detail')
|
||||
<div class="text-danger">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="col-md-12 mb-3">
|
||||
<label class="form-label">Full Detail</label>
|
||||
<textarea class="form-control" rows="7" id="advance" name="full_detail" placeholder="Full details..">{!! old('full_detail', $post->full_detail ?? '') !!}</textarea>
|
||||
@error('full_detail')
|
||||
<div class="text-danger">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
@if (empty($post))
|
||||
Save
|
||||
@else
|
||||
Save Changes
|
||||
@endif
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">Additional Details</h5>
|
||||
<div class="card-body">
|
||||
<div class="col-md-12 mb-3">
|
||||
<label class="form-label">Page</label>
|
||||
<select id="select2Basic" class="select2 form-select" name="page_id" data-allow-clear="true">
|
||||
<option value=""></option>
|
||||
@foreach ($pageList ?? [] as $pageId => $pageTitle)
|
||||
<option value="{{ $pageId }}" {{ ($post->page_id ?? '') == $pageId ? 'selected' : '' }}>
|
||||
{{ $pageTitle }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('page_id')
|
||||
<div class="text-danger">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="col-md-12 mb-3">
|
||||
<label class="form-label">Order</label>
|
||||
<input class="form-control" type="number" name="order"
|
||||
value="{{ old('order', $post->order ?? '') }}" placeholder="e.g. 1" />
|
||||
@error('order')
|
||||
<div class="text-danger">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="mb-3 col-md-12">
|
||||
<label for="sidebarFlag" class="form-label">Show on Sidebar</label>
|
||||
<div class="position-relative">
|
||||
<select id="sidebarFlag select2Basic" class="select2 form-select select2-hidden-accessible"
|
||||
data-select2-id="sidebarFlag" tabindex="-1" aria-hidden="true" name="sidebar_flag">
|
||||
<option value="11"
|
||||
{{ old('sidebar_flag', $post->sidebar_flag ?? '') == '11' ? 'selected' : '' }}>Yes
|
||||
</option>
|
||||
<option value="10"
|
||||
{{ old('sidebar_flag', $post->sidebar_flag ?? '') == '10' ? 'selected' : '' }}>No
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 col-md-12">
|
||||
<label for="language" class="form-label">Show on Navbar</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="navbar_flag">
|
||||
<option value="11"
|
||||
{{ old('navbar_flag', $post->navbar_flag ?? '') == '11' ? 'selected' : '' }}>Yes
|
||||
</option>
|
||||
<option value="10"
|
||||
{{ old('navbar_flag', $post->navbar_flag ?? '') == '10' ? 'selected' : '' }}>No
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">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" placeholder="Title..">{{ old('meta_title', $post->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" placeholder="Description..">{{ old('meta_description', $post->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" placeholder="Keywords..">{{ old('meta_keywords', $post->meta_keywords ?? '') }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('required-scripts')
|
||||
@include('admin::vendor.select2.script')
|
||||
@include('admin::vendor.tinymce.script')
|
||||
@endpush
|
Reference in New Issue
Block a user