mirror of https://github.com/4xmen/xshop.git
added mail register & reset password
fixed some bugs added simple register theme partpull/49/head
parent
802896a135
commit
87c2184f46
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\XController;
|
||||
use App\Http\Requests\GuestLogSaveRequest;
|
||||
use App\Models\Access;
|
||||
use App\Models\GuestLog;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Helper;
|
||||
use function App\Helpers\hasCreateRoute;
|
||||
|
||||
class GuestLogController extends XController
|
||||
{
|
||||
|
||||
// protected $_MODEL_ = GuestLog::class;
|
||||
// protected $SAVE_REQUEST = GuestLogSaveRequest::class;
|
||||
|
||||
protected $cols = ['ip','action','created_at','loggable_type','loggable_id'];
|
||||
protected $extra_cols = ['id'];
|
||||
|
||||
protected $searchable = ['action','ip'];
|
||||
|
||||
protected $listView = 'admin.guestlogs.guestlog-list';
|
||||
protected $formView = 'admin.guestlogs.guestlog-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(GuestLog::class, GuestLogSaveRequest::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $guestlog GuestLog
|
||||
* @param $request GuestLogSaveRequest
|
||||
* @return GuestLog
|
||||
*/
|
||||
public function save($guestlog, $request)
|
||||
{
|
||||
|
||||
$guestlog->save();
|
||||
return $guestlog;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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(GuestLog $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;
|
||||
|
||||
default:
|
||||
$msg = __('Unknown bulk action : :ACTION', ["ACTION" => $action]);
|
||||
}
|
||||
|
||||
return $this->do_bulk($msg, $action, $ids);
|
||||
}
|
||||
|
||||
public function destroy(GuestLog $item)
|
||||
{
|
||||
return parent::delete($item);
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, GuestLog $item)
|
||||
{
|
||||
return $this->bringUp($request, $item);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class GuestLogSaveRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Address;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class AuthMail extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct(
|
||||
protected string $code,
|
||||
)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*/
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
from: new Address(getSetting('email'),config('app.name')),
|
||||
subject: __('Authentication Mail').' - '. config('app.name'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
view: 'website.auth-mail',
|
||||
with:[
|
||||
'code' => $this->code
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
@extends('admin.templates.panel-form-template')
|
||||
@section('title')
|
||||
@if(isset($item))
|
||||
{{__("Edit guestlog")}} [{{$item->id}}]
|
||||
@else
|
||||
{{__("Add new guestlog")}}
|
||||
@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>
|
||||
{{__("Recommends")}}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-lg-9 ps-xl-1 ps-xxl-1">
|
||||
<div class="general-form ">
|
||||
|
||||
<h1>
|
||||
@if(isset($item))
|
||||
{{__("Edit guestlog")}} [{{$item->id}}]
|
||||
@else
|
||||
{{__("Add new guestlog")}}
|
||||
@endif
|
||||
</h1>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -0,0 +1,15 @@
|
||||
@extends('admin.templates.panel-list-template')
|
||||
|
||||
@section('list-title')
|
||||
<i class="ri-user-3-line"></i>
|
||||
{{__("GuestLogs list")}}
|
||||
@endsection
|
||||
@section('title')
|
||||
{{__("GuestLogs list")}} -
|
||||
@endsection
|
||||
@section('filter')
|
||||
{{-- Other filters --}}
|
||||
@endsection
|
||||
@section('bulk')
|
||||
{{-- <option value="-"> - </option> --}}
|
||||
@endsection
|
@ -0,0 +1,23 @@
|
||||
<section class='SimpleRegister'>
|
||||
<div class="{{gfx()['container']}}">
|
||||
<form action="/blah" method="post" class="safe-form" id="email-register">
|
||||
@csrf
|
||||
@include('components.err')
|
||||
<input type="hidden" class="safe-url" data-url="{{route('client.sign-up-now')}}">
|
||||
<h5 class="text-center">
|
||||
{{__("Register or Reset password")}}
|
||||
</h5>
|
||||
<div class="form-group my-2">
|
||||
<label for="email">
|
||||
{{__("Email")}}
|
||||
</label>
|
||||
<input type="email" id="email" required name="email" value="{{old('email')}}" placeholder="{{__("Email")}}" class="form-control">
|
||||
</div>
|
||||
|
||||
<button class="btn btn-secondary w-100">
|
||||
<i class="ri-user-add-line"></i>
|
||||
{{__("Sign-up")}}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "SimpleRegister",
|
||||
"version": "1.0",
|
||||
"author": "xStack",
|
||||
"email": "xshop@xstack.ir",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"url": "https:\/\/xstack.ir",
|
||||
"author_url": "https:\/\/4xmen.ir",
|
||||
"packages": []
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Resources\Views\Segments;
|
||||
|
||||
use App\Models\Part;
|
||||
|
||||
class SimpleRegister
|
||||
{
|
||||
public static function onAdd(Part $part = null)
|
||||
{
|
||||
|
||||
}
|
||||
public static function onRemove(Part $part = null)
|
||||
{
|
||||
|
||||
}
|
||||
public static function onMount(Part $part = null)
|
||||
{
|
||||
return $part;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
.SimpleRegister {
|
||||
// scss
|
||||
|
||||
min-height: 64vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
#email-register{
|
||||
margin: auto;
|
||||
max-width: 450px;
|
||||
background: var(--xshop-primary);
|
||||
color: var(--xshop-diff);
|
||||
padding: 1rem;
|
||||
border-radius: var(--xshop-border-radius);
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
@ -0,0 +1,6 @@
|
||||
<h4>
|
||||
{{__("Your Authentication Mail")}}
|
||||
</h4>
|
||||
<p>
|
||||
{{__("Password or new password is:")}} {{$code}}
|
||||
</p>
|
Loading…
Reference in New Issue