added galley xController

optimize ui
added imgUrl to list template
pull/44/head
A1Gard 5 months ago
parent aa974c76c3
commit f864f8cf4a

@ -45,8 +45,8 @@ class makeXcontroller extends Command
// replace variables // replace variables
$content = str_replace('User', $model, $content); $content = str_replace('User', $model, $content);
$content = str_replace('user', strtolower($model), $content);
$content = str_replace('users', strtolower($plural), $content); $content = str_replace('users', strtolower($plural), $content);
$content = str_replace('user', strtolower($model), $content);
$content = str_replace('$user', $var, $content); $content = str_replace('$user', $var, $content);
Artisan::call('make:request', ['name' => $model.'SaveRequest']); Artisan::call('make:request', ['name' => $model.'SaveRequest']);

@ -36,7 +36,7 @@ class AdminLogController extends XController
public function log(User $item){ public function log(User $item){
return redirect()->route('admin.adminlogs.index',['filter[user_id]'=> '['.$item->id.']']); return redirect()->route('admin.adminlog.index',['filter[user_id]'=> '['.$item->id.']']);
} }

@ -0,0 +1,141 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Http\Controllers\XController;
use App\Http\Requests\GallerySaveRequest;
use App\Models\Access;
use App\Models\Gallery;
use App\Models\Image;
use Illuminate\Http\Request;
use App\Helper;
use function App\Helpers\hasCreateRoute;
class GalleryController extends XController
{
// protected $_MODEL_ = Gallery::class;
// protected $SAVE_REQUEST = GallerySaveRequest::class;
protected $cols = ['title','status'];
protected $extra_cols = ['id','slug'];
protected $searchable = ['title','description'];
protected $listView = 'admin.galleries.gallery-list';
protected $formView = 'admin.galleries.gallery-form';
protected $buttons = [
'edit' =>
['title' => "Edit", 'class' => 'btn-outline-primary', 'icon' => 'ri-edit-2-line'],
'show' =>
['title' => "Detail", 'class' => 'btn-outline-light', 'icon' => 'ri-eye-line'],
'destroy' =>
['title' => "Remove", 'class' => 'btn-outline-danger delete-confirm', 'icon' => 'ri-close-line'],
];
public function __construct()
{
parent::__construct(Gallery::class, GallerySaveRequest::class);
}
/**
* @param $gallery Gallery
* @param $request GallerySaveRequest
* @return Gallery
*/
public function save($gallery, $request)
{
$gallery->title = $request->input('title');
$gallery->slug = $this->getSlug($gallery,'slug','title');
$gallery->description = $request->input('description');
$gallery->status = $request->input('status');
$gallery->user_id = auth()->id();
$gallery->save();
if ($request->hasFile('image')) {
$gallery->media()->delete();
$gallery->addMedia($request->file('image'))
->preservingOriginal() //middle method
->toMediaCollection();
}
$gallery->save();
return $gallery;
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
return view($this->formView);
}
/**
* Show the form for editing the specified resource.
*/
public function edit(Gallery $item)
{
//
return view($this->formView, compact('item'));
}
public function bulk(Request $request)
{
// dd($request->all());
$data = explode('.', $request->input('action'));
$action = $data[0];
$ids = $request->input('id');
switch ($action) {
case 'delete':
$msg = __(':COUNT items deleted successfully', ['COUNT' => count($ids)]);
$this->_MODEL_::destroy($ids);
break;
case 'publish':
$this->_MODEL_::whereIn('id', $request->input('id'))->update(['status' => 1]);
$msg = __(':COUNT items published successfully', ['COUNT' => count($ids)]);
break;
case 'draft':
$this->_MODEL_::whereIn('id', $request->input('id'))->update(['status' => 0]);
$msg = __(':COUNT items drafted successfully', ['COUNT' => count($ids)]);
break;
default:
$msg = __('Unknown bulk action : :ACTION', ["ACTION" => $action]);
}
return $this->do_bulk($msg, $action, $ids);
}
public function destroy(Gallery $item)
{
return parent::delete($item);
}
public function update(Request $request, Gallery $item)
{
return $this->bringUp($request, $item);
}
public function updateTitle(Request $request){
foreach ($request->titles as $k => $title) {
$image = Image::whereId($k)->first();
$image->title = $title;
$image->save();
}
return redirect()->back()->with(['message' => __("Titles updated")]);
}
}

@ -0,0 +1,87 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\Gallery;
use App\Models\Image;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class ImageController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request, Gallery $gallery)
{
foreach ($request->file('image') as $k => $item) {
DB::transaction(function () use ($gallery, $item, $request): void {
$newimage = $gallery->images()->create([
'title' => $gallery->title . '-' . ($gallery->images()->count() + 1),
'user_id' => auth()->id(),
]);
$newimage->addMedia($item)
->toMediaCollection();
});
}
logAdmin(__METHOD__, Gallery::class, $gallery->id);
return redirect()->back()->with(['message' => __(':COUNT Images uploaded successfully', ['COUNT' => count($request->file('image'))] )]);
}
/**
* Display the specified resource.
*/
public function show(Image $image)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(Image $image)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, Image $image)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(Image $image)
{
//
logAdmin(__METHOD__, Image::class, $image->id);
$image->delete();
return redirect()->back()->with(['message' => __('Image deleted successfully')]);
}
}

@ -18,7 +18,7 @@ class PostController extends XController
// protected $_MODEL_ = Post::class; // protected $_MODEL_ = Post::class;
// protected $SAVE_REQUEST = PostSaveRequest::class; // protected $SAVE_REQUEST = PostSaveRequest::class;
protected $cols = ['title','hash','view']; protected $cols = ['title','hash','view','status'];
protected $extra_cols = ['id', 'slug']; protected $extra_cols = ['id', 'slug'];
protected $searchable = ['title','subtitle','body']; protected $searchable = ['title','subtitle','body'];
@ -123,6 +123,14 @@ class PostController extends XController
$this->_MODEL_::withTrashed()->find($id)->restore(); $this->_MODEL_::withTrashed()->find($id)->restore();
} }
break; break;
case 'publish':
$this->_MODEL_::whereIn('id', $request->input('id'))->update(['status' => 1]);
$msg = __(':COUNT items published successfully', ['COUNT' => count($ids)]);
break;
case 'draft':
$this->_MODEL_::whereIn('id', $request->input('id'))->update(['status' => 0]);
$msg = __(':COUNT items drafted successfully', ['COUNT' => count($ids)]);
break;
/*restore**/ /*restore**/
default: default:
$msg = __('Unknown bulk action : :ACTION', ["ACTION" => $action]); $msg = __('Unknown bulk action : :ACTION', ["ACTION" => $action]);

@ -0,0 +1,32 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class GallerySaveRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
//
'title' => ['required', 'string', 'max:255','min:2'],
'description' => ['nullable', 'string'],
'status' => ['required', 'boolean'],
'image' => ['nullable', 'image', 'mimes:jpeg,png,jpg,gif,svg', 'max:2048'],
];
}
}

@ -18,7 +18,7 @@ class Gallery extends Model implements HasMedia
public $translatable = ['title','description']; public $translatable = ['title','description'];
public function images() public function images()
{ {
return $this->hasMany(Images::class, 'gallery_id', 'id')->orderBy('sort')->orderByDesc('id'); return $this->hasMany(Image::class, 'gallery_id', 'id')->orderBy('sort')->orderByDesc('id');
} }
public function registerMediaConversions(Media $media = null): void public function registerMediaConversions(Media $media = null): void
@ -35,7 +35,8 @@ class Gallery extends Model implements HasMedia
$this->addMediaConversion('gthumb')->width($t[0]) $this->addMediaConversion('gthumb')->width($t[0])
->height($t[1]) ->height($t[1])
->crop(Manipulations::CROP_CENTER, $t[0], $t[1])->optimize(); ->nonQueued()
->crop( $t[0], $t[1])->optimize();
// ->watermark(public_path('images/logo.png'))->watermarkOpacity(50); // ->watermark(public_path('images/logo.png'))->watermarkOpacity(50);
// ->withResponsiveImages(); // ->withResponsiveImages();
} }
@ -45,7 +46,7 @@ class Gallery extends Model implements HasMedia
return 'slug'; return 'slug';
} }
public function imgurl() public function imgUrl()
{ {
if ($this->getMedia()->count() > 0) { if ($this->getMedia()->count() > 0) {
return $this->getMedia()->first()->getUrl('gthumb'); return $this->getMedia()->first()->getUrl('gthumb');

@ -0,0 +1,51 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
use Spatie\Translatable\HasTranslations;
class Image extends Model implements HasMedia
{
use HasFactory,InteractsWithMedia, HasTranslations;
public $translatable = ['title'];
protected $guarded = [''];
public function gallery()
{
return $this->belongsTo(Gallery::class, 'gallery_id');
}
public function registerMediaConversions(Media $media = null): void
{
$t = explode('x', config('starter-kit.post_thumb'));
if (config('starter-kit.gallery_thumb') == null || config('starter-kit.gallery_thumb') == '') {
$t[0] = 500;
$t[1] = 500;
}
$this->addMediaConversion('image-image')->optimize();
$this->addMediaConversion('gthumb')->width($t[0])
->height($t[1])
->nonQueued()
->crop( $t[0], $t[1])->optimize();
// ->watermark(public_path('images/logo.png'))->watermarkOpacity(50);
// ->withResponsiveImages();
}
public function imgurl()
{
if ($this->getMedia()->count() > 0) {
return $this->getMedia()->first()->getUrl('gthumb');
} else {
return "no image";
}
}
}

@ -5,9 +5,9 @@ namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Database\Eloquent\Factories\Factory;
/** /**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Images> * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Image>
*/ */
class ImagesFactory extends Factory class ImageFactory extends Factory
{ {
/** /**
* Define the model's default state. * Define the model's default state.

@ -5,7 +5,7 @@ namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
class ImagesSeeder extends Seeder class ImageSeeder extends Seeder
{ {
/** /**
* Run the database seeds. * Run the database seeds.

@ -5,3 +5,11 @@ document.addEventListener('click', function(e) {
} }
} }
}); });
document.querySelectorAll('.delete-confirm')?.forEach(function (el) {
el.addEventListener('click',function (e) {
if (!confirm('Are you sure you want to delete this item?')) { // WIP Need to translate
e.preventDefault();
}
});
})

@ -89,3 +89,37 @@ a.btn,a.action-btn,a.circle-btn{
margin: 0 .5rem; margin: 0 .5rem;
} }
} }
.model-status{
width: 15px;
height: 15px;
margin: auto;
border-radius: 3px;
}
.status-0{
background: red;
}
.status-1{
background: lime;
}
.image-x64{
height: 64px;
width: 64px;
object-fit: cover;
border-radius: 5px;
}
.img-squire{
display: block;
max-width: 100%;
margin: auto;
}
.rm-img{
position: relative;
z-index: 1;
margin-bottom: -75px;
}

@ -3,11 +3,35 @@
border-color: #bc86fe; border-color: #bc86fe;
} }
.card{ .forms{
.card{
background-color: rgba(var(--bs-body-bg),.5); background-color: rgba(var(--bs-body-bg),.5);
background-image: url("../../images/pattern.png"); background-image: url("../../images/pattern.png");
backdrop-filter: blur(4px); backdrop-filter: blur(4px);
box-shadow: -2px -2px 7px #560000, 2px 2px 7px #5e00b5; box-shadow: -2px -2px 7px #560000, 2px 2px 7px #5e00b5;
}
}
main{
.card{
background-color: $lighter-color;
border: 0;
.card-header{
background: #00000011;
border: 0;
text-align: center;
}
.card-footer{
.btn{
min-width: 200px;
width: 10%;
display: block;
margin: auto;
}
}
}
} }

@ -0,0 +1,178 @@
@extends('admin.templates.panel-form-template')
@section('title')
@if(isset($item))
{{__("Edit gallery")}} [{{$item->title}}]
@else
{{__("Add new gallery")}}
@endif -
@endsection
@section('form')
<div class="row">
<div class="col-lg-3">
@include('components.err')
<div class="item-list mb-3">
<h3 class="p-3">
<i class="ri-message-3-line"></i>
{{__("Tips")}}
</h3>
<ul>
<li>
{{__("You can add images after create gallery")}}
</li>
<li>
{{__("You can choose more than image to upload")}}
</li>
<li>
{{__("We recommending add title each images")}}
</li>
</ul>
</div>
@if (isset($item))
<div class="item-list mb-3">
<h3 class="p-3">
<i class="ri-image-2-line"></i>
{{__("Index image")}}
</h3>
<div class="pb-4">
<img src="{{$item->imgUrl()}}" class="img-fluid" alt="{{$item->title}}">
</div>
</div>
@endif
</div>
<div class="col-lg-9 ps-xl-1 ps-xxl-1">
<div class="general-form ">
<h1>
@if(isset($item))
{{__("Edit gallery")}} [{{$item->title}}]
@else
{{__("Add new gallery")}}
@endif
</h1>
<div class="row">
<div class="col-md-12 mt-3">
<div class="form-group">
<label for="title">
{{__('Title')}}
</label>
<input name="title" type="text" id="title"
class="form-control @error('title') is-invalid @enderror"
placeholder="{{__('Title')}}" value="{{old('title',$item->title??null)}}"/>
</div>
</div>
<div class="col-md-12 mt-3">
<div class="form-group">
<label for="description">
{{__('Description')}}
</label>
<textarea id="description" name="description"
class="form-control @error('description') is-invalid @enderror"
placeholder="{{__('Description')}}"
rows="3">{{old('description',$item->description??null)}}</textarea>
</div>
</div>
<div class="col-md-6 mt-3">
<div class="form-group">
<label for="status">
{{__('Status')}}
</label>
<select name="status" id="status"
class="form-control @error('status') is-invalid @enderror">
<option value="1"
@if (old('status',$item->status??null) == '1' ) selected @endif >{{__("Published")}} </option>
<option value="0"
@if (old('status',$item->status??null) == '0' ) selected @endif >{{__("Draft")}} </option>
</select>
</div>
</div>
<div class="col-md-6 mt-3">
<div class="form-group">
<label for="image">
{{__('Index image')}}
</label>
<input name="image" accept=".jpg,.png,.jpeg,.gif,.svg" type="file"
class="form-control @error('image') is-invalid @enderror"
placeholder="{{__('Index image')}}" value="{{old('image',$item->image??null)}}"/>
</div>
</div>
<div class="col-md-12">
<label> &nbsp; </label>
<input name="" type="submit" class="btn btn-primary mt-2" value="{{__('Save')}}"/>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('out-of-form')
@if (isset($item))
@if($item->images->count() > 0)
<div class="card mt-3">
<div class="card-header">
{{__("Images")}}
</div>
<form action="{{route('admin.gallery.title',$item->slug)}}" method="post">
<div class="card-body">
@csrf
<div class="row">
@foreach($item->images as $img)
<div class="col-md-3">
<a href="{{route('admin.image.destroy',$img->id)}}" class="btn btn-danger delete-confirm rm-img ms-2">
<i class="ri-delete-bin-6-line"></i>
</a>
<img src="{{$img->imgUrl()}}" class="img-squire" alt="">
<div class="row mt-2">
<div class="col-md-10">
<input type="text" class="form-control" name="titles[{{$img->id}}]"
value="{{$img->title}}"/>
</div>
<div class="col-md-2">
@if(config('app.xlang'))
<a href="{{route('admin.lang.model',[$img->id,\Xmen\StarterKit\Models\Image::class])}}"
class="btn btn-outline-dark translat-btn">
<i class="ri-translate"></i>
</a>
@endif
</div>
</div>
</div>
@endforeach
</div>
<br>
</div>
<div class="card-footer">
<input type="submit" class="btn btn-primary" value="{{__("Save")}}"/>
</div>
</form>
</div>
@endif
<div class="pb-5">
<form class="card mt-3 mb-5" method="post" enctype="multipart/form-data"
action="{{route('admin.image.store',$item->slug)}}">
@csrf
<div class="card-header">
{{__("Upload new images")}}
</div>
<div class="card-body">
<input type="file" class="form-control" name="image[]" multiple accept="image/*"
id="gallery_images"/>
<ul id="newimgs">
</ul>
</div>
<div class="card-footer">
<input type="submit" class="btn btn-dark" value="{{__("Upload images")}}"/>
</div>
</form>
</div>
@endif
@endsection

@ -0,0 +1,16 @@
@extends('admin.templates.panel-list-template')
@section('list-title')
<i class="ri-user-3-line"></i>
{{__("Galleries list")}}
@endsection
@section('title')
{{__("Galleries list")}} -
@endsection
@section('filter')
{{-- Other filters --}}
@endsection
@section('bulk')
<option value="publish"> {{__("Publish")}} </option>
<option value="draft"> {{__("Draft")}} </option>
@endsection

@ -11,5 +11,6 @@
{{-- Other filters --}} {{-- Other filters --}}
@endsection @endsection
@section('bulk') @section('bulk')
{{-- <option value="-"> - </option> --}} <option value="publish"> {{__("Publish")}} </option>
<option value="draft"> {{__("Draft")}} </option>
@endsection @endsection

@ -37,4 +37,5 @@
@endif @endif
@yield('form') @yield('form')
</form> </form>
@yield('out-of-form')
@endsection @endsection

@ -119,6 +119,11 @@
type="checkbox" role="switch"> type="checkbox" role="switch">
</div> </div>
</th> </th>
@if(isset($items[0]) && method_exists($items[0],'imgUrl'))
<th>
{{__("image")}}
</th>
@endif
@foreach($cols as $col) @foreach($cols as $col)
<th> <th>
<a href="?sort={{$col}}{{sortSuffix($col)}}&{{queryBuilder('sort')}}"> <a href="?sort={{$col}}{{sortSuffix($col)}}&{{queryBuilder('sort')}}">
@ -126,7 +131,7 @@
</a> </a>
</th> </th>
@endforeach @endforeach
{{-- @yield('table-head')--}} {{-- @yield('table-head')--}}
<th> <th>
</th> </th>
@ -142,6 +147,7 @@
@else @else
@foreach($items as $item) @foreach($items as $item)
<tr> <tr>
<td> <td>
<input type="checkbox" id="chk-{{$item->id}}" class="chkbox" <input type="checkbox" id="chk-{{$item->id}}" class="chkbox"
name="id[{{$item->id}}]" value="{{$item->id}}"> name="id[{{$item->id}}]" value="{{$item->id}}">
@ -149,6 +155,11 @@
{{$item->id}} {{$item->id}}
</label> </label>
</td> </td>
@if(isset($item) && method_exists($item,'imgUrl'))
<td>
<img src="{{$item->imgUrl()}}" class="image-x64" alt="">
</td>
@endif
@foreach($cols as $k => $col) @foreach($cols as $k => $col)
@if($k == 0 && hasRoute('edit')) @if($k == 0 && hasRoute('edit'))
<td> <td>
@ -164,13 +175,21 @@
@case($col == 'parent_id') @case($col == 'parent_id')
{{ $item->parent?->{$cols[0]}??'-' }} {{ $item->parent?->{$cols[0]}??'-' }}
@break @break
@case($col == 'status')
<div class="model-status status-{{$item->status}}"></div>
@break
@case($col == 'user_id')
<a href="{{route('admin.user.edit',$item->user?->email)}}">
{{ $item->user?->name??'-' }}
</a>
@break
@default @default
{{$item->$col}} {{$item->$col}}
@endswitch @endswitch
</td> </td>
@endif @endif
@endforeach @endforeach
{{-- @yield('table-body')--}} {{-- @yield('table-body')--}}
<td> <td>
@if(strpos(request()->url(),'trashed') != false && hasRoute('restore')) @if(strpos(request()->url(),'trashed') != false && hasRoute('restore'))
@ -221,7 +240,8 @@
@else @else
@if( hasRoute('restore') && $item->trashed()) @if( hasRoute('restore') && $item->trashed())
<a class="btn btn-success btn-sm mx-1" <a class="btn btn-success btn-sm mx-1"
href="{{getRoute('restore',$item->id)}}" {{--dont change this id to getRouteKeyName --}} href="{{getRoute('restore',$item->id)}}"
{{--dont change this id to getRouteKeyName --}}
data-bs-toggle="tooltip" data-bs-toggle="tooltip"
data-bs-placement="top" data-bs-placement="top"
data-bs-custom-class="custom-tooltip" data-bs-custom-class="custom-tooltip"

@ -4,6 +4,8 @@
@endsection @endsection
@section('content') @section('content')
<div class="forms">
<div class="card" id="raw-form"> <div class="card" id="raw-form">
<div class="card-header"> <div class="card-header">
{{__("Login")}} {{__("Login")}}
@ -23,7 +25,7 @@
</span> </span>
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" <input id="email" type="email" class="form-control @error('email') is-invalid @enderror"
name="email" value="{{ old('email') }}" required autocomplete="email" name="email" value="{{ old('email') }}" required autocomplete="email"
autofocus placeholder="{{ __('Email Address') }}" > autofocus placeholder="{{ __('Email Address') }}">
</div> </div>
@error('email') @error('email')
@ -44,7 +46,8 @@
<i class="ri-lock-password-line"></i> <i class="ri-lock-password-line"></i>
</span> </span>
<input id="password" type="password" <input id="password" type="password"
class="form-control @error('password') is-invalid @enderror" name="password" required class="form-control @error('password') is-invalid @enderror" name="password"
required
autocomplete="current-password" placeholder="{{ __('Password') }}"> autocomplete="current-password" placeholder="{{ __('Password') }}">
</div> </div>
@ -59,7 +62,8 @@
<div class="row mb-3"> <div class="row mb-3">
<div class="col-md-6"> <div class="col-md-6">
<div class="form-check form-switch mt-1"> <div class="form-check form-switch mt-1">
<input class="form-check-input" {{ old('remember',true) ? 'checked' : '' }} name="remember" <input class="form-check-input"
{{ old('remember',true) ? 'checked' : '' }} name="remember"
type="checkbox" role="switch" id="remember" aria-label="Username" type="checkbox" role="switch" id="remember" aria-label="Username"
aria-describedby="basic-addon1"> aria-describedby="basic-addon1">
<label class="form-check-label" for="remember">{{ __('Remember Me') }}</label> <label class="form-check-label" for="remember">{{ __('Remember Me') }}</label>
@ -82,4 +86,6 @@
</form> </form>
</div> </div>
</div> </div>
</div>
@endsection @endsection

@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="container"> <div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center forms">
<div class="col-md-8"> <div class="col-md-8">
<div class="card"> <div class="card">
<div class="card-header">{{ __('Confirm Password') }}</div> <div class="card-header">{{ __('Confirm Password') }}</div>

@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="container"> <div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center forms">
<div class="col-md-8"> <div class="col-md-8">
<div class="card"> <div class="card">
<div class="card-header">{{ __('Reset Password') }}</div> <div class="card-header">{{ __('Reset Password') }}</div>

@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="container"> <div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center forms">
<div class="col-md-8"> <div class="col-md-8">
<div class="card"> <div class="card">
<div class="card-header">{{ __('Reset Password') }}</div> <div class="card-header">{{ __('Reset Password') }}</div>

@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="container"> <div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center forms">
<div class="col-md-8"> <div class="col-md-8">
<div class="card"> <div class="card">
<div class="card-header">{{ __('Register') }}</div> <div class="card-header">{{ __('Register') }}</div>

@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="container"> <div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center forms">
<div class="col-md-8"> <div class="col-md-8">
<div class="card"> <div class="card">
<div class="card-header">{{ __('Verify Your Email Address') }}</div> <div class="card-header">{{ __('Verify Your Email Address') }}</div>

@ -91,7 +91,7 @@
</a> </a>
</li> </li>
<li> <li>
<a> <a href="{{route('admin.gallery.index')}}">
<i class="ri-gallery-fill"></i> <i class="ri-gallery-fill"></i>
{{__("Galleries")}} {{__("Galleries")}}
</a> </a>
@ -189,7 +189,7 @@
</a> </a>
</li> </li>
<li> <li>
<a href="{{route('admin.adminlogs.index')}}"> <a href="{{route('admin.adminlog.index')}}">
<i class="ri-list-check-3"></i> <i class="ri-list-check-3"></i>
{{__('Logs of admins')}} {{__('Logs of admins')}}
</a> </a>

@ -20,8 +20,11 @@ Route::prefix(config('app.panel.prefix'))->name('admin.')->group(
Route::get('/',[\App\Http\Controllers\HomeController::class,'index'])->name('dash'); Route::get('/',[\App\Http\Controllers\HomeController::class,'index'])->name('dash');
Route::post('ckeditor/upload', [\App\Http\Controllers\Admin\CkeditorController::class,'upload'])->name('ckeditor.upload'); Route::post('ckeditor/upload', [\App\Http\Controllers\Admin\CkeditorController::class,'upload'])->name('ckeditor.upload');
Route::get('adminlogs', [\App\Http\Controllers\Admin\AdminLogController::class,'index'])->name('adminlogs.index'); Route::get('adminlogs', [\App\Http\Controllers\Admin\AdminLogController::class,'index'])->name('adminlog.index');
Route::get('adminlogs/{user}', [\App\Http\Controllers\Admin\AdminLogController::class,'log'])->name('adminlogs.show'); Route::get('adminlogs/{user}', [\App\Http\Controllers\Admin\AdminLogController::class,'log'])->name('adminlog.show');
Route::post('images/store/{gallery}', [\App\Http\Controllers\Admin\ImageController::class,'store'])->name('image.store');
Route::get('images/destroy/{image}', [\App\Http\Controllers\Admin\ImageController::class,'destroy'])->name('image.destroy');
Route::prefix('users')->name('user.')->group( Route::prefix('users')->name('user.')->group(
function () { function () {
@ -54,7 +57,7 @@ Route::prefix(config('app.panel.prefix'))->name('admin.')->group(
Route::get('', [\App\Http\Controllers\Admin\PostController::class, 'index'])->name('index'); Route::get('', [\App\Http\Controllers\Admin\PostController::class, 'index'])->name('index');
Route::get('create', [\App\Http\Controllers\Admin\PostController::class, 'create'])->name('create'); Route::get('create', [\App\Http\Controllers\Admin\PostController::class, 'create'])->name('create');
Route::post('store', [\App\Http\Controllers\Admin\PostController::class, 'store'])->name('store'); Route::post('store', [\App\Http\Controllers\Admin\PostController::class, 'store'])->name('store');
Route::post('show/{item}', [\App\Http\Controllers\Admin\PostController::class, 'show'])->name('show'); Route::get('show/{item}', [\App\Http\Controllers\Admin\PostController::class, 'show'])->name('show');
Route::get('edit/{item}', [\App\Http\Controllers\Admin\PostController::class, 'edit'])->name('edit'); Route::get('edit/{item}', [\App\Http\Controllers\Admin\PostController::class, 'edit'])->name('edit');
Route::post('update/{item}', [\App\Http\Controllers\Admin\PostController::class, 'update'])->name('update'); Route::post('update/{item}', [\App\Http\Controllers\Admin\PostController::class, 'update'])->name('update');
Route::get('delete/{item}', [\App\Http\Controllers\Admin\PostController::class, 'destroy'])->name('destroy'); Route::get('delete/{item}', [\App\Http\Controllers\Admin\PostController::class, 'destroy'])->name('destroy');
@ -62,5 +65,17 @@ Route::prefix(config('app.panel.prefix'))->name('admin.')->group(
Route::post('bulk', [\App\Http\Controllers\Admin\PostController::class, "bulk"])->name('bulk'); Route::post('bulk', [\App\Http\Controllers\Admin\PostController::class, "bulk"])->name('bulk');
Route::get('trashed', [\App\Http\Controllers\Admin\PostController::class, "trashed"])->name('trashed'); Route::get('trashed', [\App\Http\Controllers\Admin\PostController::class, "trashed"])->name('trashed');
}); });
Route::prefix('galleries')->name('gallery.')->group(
function () {
Route::get('', [\App\Http\Controllers\Admin\GalleryController::class, 'index'])->name('index');
Route::get('create', [\App\Http\Controllers\Admin\GalleryController::class, 'create'])->name('create');
Route::post('store', [\App\Http\Controllers\Admin\GalleryController::class, 'store'])->name('store');
Route::get('show/{item}', [\App\Http\Controllers\Admin\GalleryController::class, 'show'])->name('show');
Route::post('title/update', [\App\Http\Controllers\Admin\GalleryController::class, 'updateTitle'])->name('title');
Route::get('edit/{item}', [\App\Http\Controllers\Admin\GalleryController::class, 'edit'])->name('edit');
Route::post('update/{item}', [\App\Http\Controllers\Admin\GalleryController::class, 'update'])->name('update');
Route::get('delete/{item}', [\App\Http\Controllers\Admin\GalleryController::class, 'destroy'])->name('destroy');
Route::post('bulk', [\App\Http\Controllers\Admin\GalleryController::class, "bulk"])->name('bulk');
});
}); });
}); });

Loading…
Cancel
Save