Compare commits

...

8 Commits

Author SHA1 Message Date
A1Gard 447dd3082b added translator to setting
WIP: setting titles
3 months ago
A1Gard d1c9c4140e added langs to sitemap 3 months ago
A1Gard f1813205e8 added new lang route for client side 3 months ago
A1Gard ea26cc1155 fixed routes 3 months ago
A1Gard 65a74f80c8 added api to env 3 months ago
A1Gard c91c3710f9 added translator engine
improved ui/ux some pages (add btn)
WIP: website route to apply translate for vistor
3 months ago
A1Gard c01a88b731 fixed product search 3 months ago
A1Gard 54e1d13337 added multi lang to models
update translates
fixed product search
update starterkit
WIP: search for models have translate
3 months ago

@ -66,3 +66,4 @@ PAY_GATWAY=zarinpal
THUMBNAIL_SIZE=600x600
XLANG=false
XLANG_MAIN=en
XLANG_API_URL="http://5.255.98.77:3001"

@ -19,7 +19,7 @@ jobs:
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Dependencies
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions

@ -125,7 +125,7 @@ function showCats($cats = [], $liClass = '', $ulClass = '')
$txt = '';
foreach ($cats as $cat) {
$txt .= '<li class="' . $liClass . '">
<a href="' . route('cat', $cat->slug) . '">' . $cat->name . '</a>';
<a href="' . route('product-category.show', $cat->slug) . '">' . $cat->name . '</a>';
if ($cat->children()->count() > 0) {
// $txt .='<li> '.$cat->name;
$txt .= '<ul class="' . $ulClass . '">';
@ -261,34 +261,34 @@ function MenuShowItems($items)
$out .= '<li>';
switch ($item->kind) {
case "tag":
$out .= '<a href="' . route('n.tag', $item->meta) . '" >' . $item->title . '</a>';
$out .= '<a href="' . route('tag.show', $item->meta) . '" >' . $item->title . '</a>';
break;
case "link":
$out .= '<a href="' . $item->meta . '" >' . $item->title . '</a>';
break;
case "news":
$n = Post::whereId($item->menuable_id)->firstOrFail();
$out .= '<a href="' . route('n.show', $n->slug) . '" >' . $item->title . '</a>';
$out .= '<a href="' . route('post.show', $n->slug) . '" >' . $item->title . '</a>';
break;
case "tag-sub":
$out .= $item->title;
$news = Post::withAnyTag($item->meta)->limit(10)->get(['title', 'slug']);
$out .= '<ul>';
foreach ($news as $new) {
$out .= '<li><a href="' . route('n.show', $new->slug) . '" >' . $new->title . '</a></li>';
$out .= '<li><a href="' . route('post.show', $new->slug) . '" >' . $new->title . '</a></li>';
}
$out .= '</ul>';
break;
case "cat":
$cat = Category::whereId($item->menuable_id)->firstOrFail();
$out .= '<a href="' . route('n.cat', $cat->slug) . '" >' . $item->title . '</a>';
$out .= '<a href="' . route('category.show', $cat->slug) . '" >' . $item->title . '</a>';
break;
case "cat-sub":
$out .= $item->title;
$cats = Category::where('parent_id', $item->menuable_id)->limit(20)->get(['name', 'slug']);
$out .= '<ul>';
foreach ($cats as $c) {
$out .= '<li><a href="' . route('n.cat', $c->slug) . '" >' . $c->name . '</a></li>';
$out .= '<li><a href="' . route('product-category.show', $c->slug) . '" >' . $c->name . '</a></li>';
}
$out .= '</ul>';
break;
@ -298,7 +298,7 @@ function MenuShowItems($items)
$news = $cat->posts()->limit(10)->get(['slug', 'title']);
$out .= '<ul>';
foreach ($news as $new) {
$out .= '<li><a href="' . route('n.show', $new->slug) . '" >' . $new->title . '</a></li>';
$out .= '<li><a href="' . route('post.show', $new->slug) . '" >' . $new->title . '</a></li>';
}
$out .= '</ul>';
break;
@ -455,7 +455,7 @@ function getProductByCatQ($id, $order = 'id', $limit = 10)
* @param $id
* @return Cat[]|\Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection|\LaravelIdea\Helper\App\Models\_IH_Cat_C
*/
function getSubCats($id,$limit = 99)
function getSubCats($id, $limit = 99)
{
return Cat::where('parent_id', $id)->limit($limit)->get();
}
@ -603,8 +603,8 @@ function showMeta($key, $value)
*/
function time2persian($date, $format = 'Y/m/d')
{
if ($date == null){
return '-';
if ($date == null) {
return '-';
}
$dt = new TDate();
return $dt->PDate($format, $date);
@ -682,14 +682,14 @@ function makeProductBreadcrumb(Product $p, Cat $c)
$items = [
[
'name' => $c->name,
'link' => \route('cat', $c->slug)
'link' => \route('product-category.show', $c->slug)
]
];
while ($c->parent_id != null) {
$c = Cat::where('id', $c->parent_id)->first();
$items[] = [
'name' => $c->name,
'link' => \route('cat', $c->slug)
'link' => \route('product-category.show', $c->slug)
];
}
@ -824,7 +824,7 @@ function sendSMSText2($number, $content)
//execute post
$result = curl_exec($ch);
return json_decode($result,true);
return json_decode($result, true);
}
/***
@ -874,3 +874,54 @@ function findLink($html)
return $match[1];
}
function showMenuMange2($arr)
{
$back = '';
$tr = '';
foreach ($arr as $menu) {
$ol = '';
if ($menu->children()->count() > 0) {
$ol = '<ol>' . showMenuMange2($menu->children()->orderBy('sort')->get()) . '</ol>';
}
if (config('app.xlang')) {
$l = route('admin.lang.model', [$menu->id, MenuItem::class]);
$tr = <<<TR
<a href="$l" class="float-end">
<i class="ri-translate"></i>
</a>
TR;
}
$back .= <<<LI
<li class="list-group-item"
data-menuabletype="$menu->menuable_type"
data-menuableid="$menu->menuable_id"
data-meta="$menu->meta"
data-kind="$menu->kind"
data-item-id="$menu->id"
data-title="$menu->title"
>
<span>
$menu->title
$tr
</span>
$ol
</li>
LI;
}
return $back;
}
function xroute($rt, $args = [])
{
if (config('app.xlang_main') != app()->getLocale()) {
return \route( $rt, $args);
} else {
return \route($rt, $args);
}
}

@ -176,7 +176,7 @@ class ProductController extends Controller
}
}
if ($request->has('q')){
$n->where('name','LIKE','%'.$request->input('q').'%');
$n->where('name->'.config('app.xlang_main'),'LIKE','%'.$request->input('q').'%');
}
$products = $n->paginate(20);
return view('admin.product.productIndex', compact('products'));

@ -4,11 +4,22 @@ namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Http\Requests\XlangSaveRequest;
use App\Models\Cat;
use App\Models\Product;
use App\Models\Prop;
use App\Models\Setting;
use App\Models\Xlang;
use Illuminate\Http\Request;
use GuzzleHttp\Client;
use Illuminate\Support\Facades\Artisan;
use Xmen\StarterKit\Models\Category;
use Xmen\StarterKit\Models\Clip;
use Xmen\StarterKit\Models\Gallery;
use Xmen\StarterKit\Models\Image;
use Xmen\StarterKit\Models\MenuItem;
use Xmen\StarterKit\Models\Post;
use Xmen\StarterKit\Models\Slider;
use function Xmen\StarterKit\Helpers\logAdmin;
use function Xmen\StarterKit\Helpers\logAdminBatch;
@ -16,12 +27,33 @@ const PREFIX_PATH = __DIR__ . '/../../../../';
class XlangController extends Controller
{
public $allowedModels = [
Product::class,
Cat::class,
Post::class,
Category::class,
Slider::class,
MenuItem::class,
Gallery::class,
Clip::class,
Prop::class,
Setting::class,
Image::class
];
public function createOrUpdate(Xlang $xlang, XlangSaveRequest $request)
{
$xlang->name = $request->input('name');
$xlang->tag = $request->input('tag');
$xlang->rtl = $request->has('rtl');
$xlang->is_default = $request->has('is_default');
if ($xlang->is_default) {
Xlang::where('is_default', '1')->update([
'is_default' => 0,
]);
}
if ($request->hasFile('img')) {
$name = time() . '.' . request()->img->getClientOriginalExtension();
@ -65,19 +97,22 @@ class XlangController extends Controller
public function store(XlangSaveRequest $request)
{
//
define("TRANSLATE_CONFIG_PATH", PREFIX_PATH . 'config/translator.php');
define("TRANSLATE_NEW_FILE", PREFIX_PATH . 'resources/lang/' . $request->tag . '.json');
$config = file_get_contents(TRANSLATE_CONFIG_PATH);
$re = '/\'languages\' \=\> (.*)\,/m';
preg_match_all($re, $config, $matches, PREG_SET_ORDER, 0);
$oldLangs = $matches[0][1];
$newLans = json_encode(array_unique(array_merge(json_decode($oldLangs), [$request->tag])));
$newConfig = (str_replace($oldLangs, $newLans, $config));
file_put_contents(TRANSLATE_CONFIG_PATH, $newConfig);
if (!file_exists(TRANSLATE_NEW_FILE)) {
file_put_contents(TRANSLATE_NEW_FILE, '{}');
if ($request->tag != 'en') {
define("TRANSLATE_CONFIG_PATH", PREFIX_PATH . 'config/translator.php');
define("TRANSLATE_NEW_FILE", PREFIX_PATH . 'resources/lang/' . $request->tag . '.json');
$config = file_get_contents(TRANSLATE_CONFIG_PATH);
$re = '/\'languages\' \=\> (.*)\,/m';
preg_match_all($re, $config, $matches, PREG_SET_ORDER, 0);
$oldLangs = $matches[0][1];
$newLans = json_encode(array_unique(array_merge(json_decode($oldLangs), [$request->tag])));
$newConfig = (str_replace($oldLangs, $newLans, $config));
file_put_contents(TRANSLATE_CONFIG_PATH, $newConfig);
if (!file_exists(TRANSLATE_NEW_FILE)) {
file_put_contents(TRANSLATE_NEW_FILE, '{}');
}
}
$xlang = new Xlang();
@ -141,6 +176,7 @@ class XlangController extends Controller
public function translate()
{
$langs = Xlang::all();
// return Product::where('name->en',null)->get();
return view('admin.langs.translateIndex', compact('langs'));
}
@ -150,6 +186,7 @@ class XlangController extends Controller
define("TRANSLATE_FILE", PREFIX_PATH . 'resources/lang/' . $tag . '.json');
return response()->download(TRANSLATE_FILE, $tag . '.json');
}
public function ai($tag)
{
@ -157,17 +194,17 @@ class XlangController extends Controller
define("TRANSLATE_FILE", PREFIX_PATH . 'resources/lang/' . $tag . '.json');
$file = file_get_contents(TRANSLATE_FILE);
$url = 'http://5.255.98.77:3001/json?form=en&to='.$tag;
$url = config('app.xlang_api_url').'/json?form=en&to=' . $tag;
$client = new Client([
'headers' => [ 'Content-Type' => 'application/json' ]
'headers' => ['Content-Type' => 'application/json']
]);
$response = $client->post($url,
['body' => $file]
);
file_put_contents(TRANSLATE_FILE,$response->getBody());
return redirect()->back()->with(['message' => __("Translated by ai xstack service:").' '.$tag]);
file_put_contents(TRANSLATE_FILE, $response->getBody()->getContents());
return redirect()->back()->with(['message' => __("Translated by ai xstack service:") . ' ' . $tag]);
}
public function upload($tag, Request $request)
@ -181,7 +218,7 @@ class XlangController extends Controller
return redirect()->back()->withErrors(__("Invalid json file!"));
}
file_put_contents(TRANSLATE_FILE, $data);
return redirect()->back()->with(['message' => __("Translate updated")]);
return redirect()->back()->with(['message' => __("Translate updated")]);
}
public function bulk(Request $request)
@ -196,6 +233,73 @@ class XlangController extends Controller
default:
$msg = __('Unknown bulk action :' . $request->input('bulk'));
}
return redirect()->route('admin.customer.index')->with(['message' => $msg]);
return redirect()->route('admin.lang.index')->with(['message' => $msg]);
}
public function translateModel($id, $model)
{
if (!in_array($model, $this->allowedModels)) {
return abort(404);
}
$langs = Xlang::where('is_default', 0)->get();
$cls = $model;
$model = ($model)::where('id', $id)->firstOrFail();
// return $model;
$translates = $model->translatable;
return view('admin.langs.translate', compact('model', 'translates', 'langs', 'cls'));
}
public function translateModelSave($id, $model, Request $request)
{
if (!in_array($model, $this->allowedModels)) {
return abort(404);
}
$langs = Xlang::where('is_default', 0)->get();
$model = ($model)::where('id', $id)->firstOrFail();
// $model = Product::whereId('id',$id)->first();
foreach ($request->input('data') as $lang => $items) {
foreach ($items as $k => $item) {
if ($item != null) {
$model->setTranslation($k, $lang, $item);
}
}
}
$model->save();
return redirect()->back()->with(['message' => __('Translate updated')]);
}
public function translateModelAi($id, $model, $tag, $field)
{
if (!in_array($model, $this->allowedModels)) {
return abort(404);
}
$langs = Xlang::where('is_default', 0)->get();
$model = ($model)::where('id', $id)->firstOrFail();
// $model = Product::whereId('id',$id)->first();
$url = config('app.xlang_api_url').'/text?form=' . config('app.xlang_main') . '&to=' . $tag;
$client = new Client([
'headers' => ['Content-Type' => 'application/x-www-form-urlencoded']
]);
$response = $client->post($url,
['form_params' => ['body' => $model->$field]],
);
// file_put_contents(TRANSLATE_FILE, $response->getBody());
if ($response->getStatusCode() != 200) {
return redirect()->back()->withErrors(__("API error!"));
}
// dd($response->getBody()->getContents());
$model->setTranslation($field, $tag, $response->getBody()->getContents());
$model->save();
return redirect()->back()->with(['message' => __('Translate updated')]);
}
}

@ -19,7 +19,6 @@ use PHPUnit\Util\Color;
use PDF;
class CustomerController extends Controller
{
/**
@ -30,11 +29,11 @@ class CustomerController extends Controller
public function index()
{
//
if(!\Auth::guard('customer')->check()){
if (!\Auth::guard('customer')->check()) {
return redirect()->route('sign');
}
$customer = Customer::whereId(\Auth::guard('customer')->id())->firstOrFail();
return view('website.customer',compact('customer'));
return view('website.customer', compact('customer'));
}
/**
@ -50,7 +49,7 @@ class CustomerController extends Controller
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
@ -61,7 +60,7 @@ class CustomerController extends Controller
/**
* Display the specified resource.
*
* @param \App\Models\Customer $customer
* @param \App\Models\Customer $customer
* @return \Illuminate\Http\Response
*/
public function show(Customer $customer)
@ -72,7 +71,7 @@ class CustomerController extends Controller
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Customer $customer
* @param \App\Models\Customer $customer
* @return \Illuminate\Http\Response
*/
public function edit(Customer $customer)
@ -83,8 +82,8 @@ class CustomerController extends Controller
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\Customer $customer
* @param \Illuminate\Http\Request $request
* @param \App\Models\Customer $customer
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Customer $customer)
@ -95,7 +94,7 @@ class CustomerController extends Controller
/**
* Remove the specified resource from storage.
*
* @param \App\Models\Customer $customer
* @param \App\Models\Customer $customer
* @return \Illuminate\Http\Response
*/
public function destroy(Customer $customer)
@ -103,35 +102,54 @@ class CustomerController extends Controller
//
}
public function invoice(Invoice $invoice){
public function invoiceLang($lang, Invoice $invoice)
{
return $this->invoice($invoice);
}
public function invoice(Invoice $invoice)
{
$options = new QROptions([
'version' => 5,
'version' => 5,
'outputType' => QRCode::OUTPUT_MARKUP_SVG,
'eccLevel' => QRCode::ECC_L,
'eccLevel' => QRCode::ECC_L,
// 'imageTransparent' => true,
]);
$qr = new QRCode($options);
return view('website.invoice',compact('invoice','qr'));
return view('website.invoice', compact('invoice', 'qr'));
}
public function qr($hash){
$invoice = Invoice::where('hash',$hash)->firstOrFail();
public function qrLang($lang, $hash)
{
return $this->qr($hash);
}
public function qr($hash)
{
$invoice = Invoice::where('hash', $hash)->firstOrFail();
$options = new QROptions([
'version' => 5,
'version' => 5,
'outputType' => QRCode::OUTPUT_MARKUP_SVG,
'eccLevel' => QRCode::ECC_L,
'eccLevel' => QRCode::ECC_L,
// 'imageTransparent' => true,
]);
$qr = new QRCode($options);
return view('website.qr',compact('invoice','qr'));
return view('website.qr', compact('invoice', 'qr'));
}
public function pdfLang($lang, $hash)
{
return $this->pdf($hash);
}
public function pdf($hash){
$invoice = Invoice::where('hash',$hash)->firstOrFail();
public function pdf($hash)
{
$invoice = Invoice::where('hash', $hash)->firstOrFail();
$options = new QROptions([
'version' => 5,
'version' => 5,
'outputType' => QRCode::OUTPUT_MARKUP_SVG,
'eccLevel' => QRCode::ECC_L,
'eccLevel' => QRCode::ECC_L,
// 'imageTransparent' => true,
]);
$qr = new QRCode($options);
@ -146,14 +164,15 @@ class CustomerController extends Controller
// $p = view('website.pdf',compact('invoice','qr'))->render();
}
public function SendTicket(TicketSaveRequest $request){
public function SendTicket(TicketSaveRequest $request)
{
$t = new Ticket();
if ($request->has('title')){
if ($request->has('title')) {
$t->title = $request->title;
}else{
if (Ticket::whereId($request->parent_id)->firstOrFail()->customer_id != auth('customer')->id()){
} else {
if (Ticket::whereId($request->parent_id)->firstOrFail()->customer_id != auth('customer')->id()) {
return abort(403);
}else{
} else {
$t->parent_id = $request->parent_id;
}
}
@ -163,24 +182,31 @@ class CustomerController extends Controller
return redirect()->back()->with(['message' => __('Ticket has been sent')]);
}
public function ticket(Ticket $ticket){
if ($ticket->customer_id != auth('customer')->id()){
public function ticketLang($lang, Ticket $ticket)
{
return $this->ticket($ticket);
}
public function ticket(Ticket $ticket)
{
if ($ticket->customer_id != auth('customer')->id()) {
return abort(403);
}
return view('website.ticket',compact('ticket'));
return view('website.ticket', compact('ticket'));
}
public function credit(Invoice $invoice){
public function credit(Invoice $invoice)
{
$c = Customer::whereId(auth('customer')->id())->first();
if($c->credit == 0){
if ($c->credit == 0) {
return redirect()->back()->with(['error' => __("You don't have any credit")]);
}
if ($c->credit > $invoice->total_price){
if ($c->credit > $invoice->total_price) {
$invoice->credit_price = $invoice->total_price;
$invoice->status = Invoice::COMPLETED;
$c->credit = $c->credit - $invoice->total_price;
}else{
$invoice->credit_price = $c->credit ;
} else {
$invoice->credit_price = $c->credit;
$c->credit = 0;
}
$invoice->save();
@ -188,12 +214,13 @@ class CustomerController extends Controller
$cr = new Credit();
$cr->invoice_id = $invoice->id;
$cr->customer_id = $c->id;
$cr->amount = $invoice->credit_price;
$cr->amount = $invoice->credit_price;
$cr->save();
return redirect()->route('customer')->with(['message' => __('Credit applied')]);
}
public function saveAddress(AddressSaveRequest $request){
public function saveAddress(AddressSaveRequest $request)
{
$ad = new Address();
$ad->address = $request->address;
$ad->customer_id = auth('customer')->id();
@ -204,8 +231,14 @@ class CustomerController extends Controller
return redirect()->route('customer')->with(['message' => __('Address saved')]);
}
public function remAddress(Address $address){
if ($address->customer_id == auth('customer')->id()){
public function remAddressLang($lang, Address $address)
{
return $this->remAddress($address);
}
public function remAddress(Address $address)
{
if ($address->customer_id == auth('customer')->id()) {
$address->delete();
}
return redirect()->route('customer')->with(['message' => __('Address removed')]);

@ -80,7 +80,7 @@ class WebsiteController extends Controller
->orderByDesc($this->sort)->orderByDesc('id');
if ($request->has('ext')) {
$q = $q->where('stock_status', 'IN_STOCK')
->where('stock_quantity','>',0);
->where('stock_quantity', '>', 0);
}
if ($request->has('from')) {
$q = $q->where('price', '>=', $request->input('from'));
@ -110,29 +110,34 @@ class WebsiteController extends Controller
$q = $q->orderByDesc('sell_count');
}
if (isset($request->meta) && isset($request->meta['material'])){
if (isset($request->meta) && isset($request->meta['material'])) {
// dd(array_column(json_decode($request->meta['material'],true),'value'));
if (count(json_decode($request->meta['material'],true) ) > 0){
$q->whereMetaIn('material',array_column(json_decode($request->meta['material'],true),'value'));
if (count(json_decode($request->meta['material'], true)) > 0) {
$q->whereMetaIn('material', array_column(json_decode($request->meta['material'], true), 'value'));
}
}
if (isset($request->meta) && isset($request->meta['size'])) {
$id = Quantity::where('count','>',0)
->where('data','LIKE','%"size":"'.$request->meta['size'].'"%')
$id = Quantity::where('count', '>', 0)
->where('data', 'LIKE', '%"size":"' . $request->meta['size'] . '"%')
->pluck('product_id')->toArray();
$q->whereIn('id',$id);
$q->whereIn('id', $id);
}
if (isset($request->meta) && isset($request->meta['color'])) {
$id = Quantity::where('count','>',0)
->where('data','LIKE','%"color":"'.$request->meta['color'].'"%')
$id = Quantity::where('count', '>', 0)
->where('data', 'LIKE', '%"color":"' . $request->meta['color'] . '"%')
->pluck('product_id')->toArray();
$q->whereIn('id',$id);
$q->whereIn('id', $id);
}
$products = $q->paginate(16);
return view('website.cat', compact('cat', 'products'));
}
public function catLang($lang, Cat $cat, Request $request)
{
return $this->cat($cat, $request);
}
public function products()
{
$sld = Slider::inRandomOrder()->first();
@ -144,15 +149,15 @@ class WebsiteController extends Controller
public function product($pro)
{
if (is_numeric($pro)){
if (is_numeric($pro)) {
$pro = Product::whereId($pro)->first();
if ($pro == null){
if ($pro == null) {
$pro = Product::inRandomOrder()->limit(1)->first();
}
return redirect()->route('product',$pro->slug);
return redirect()->route('product', $pro->slug);
}else{
} else {
$pro = Product::whereSlug($pro)->first();
}
@ -164,6 +169,11 @@ class WebsiteController extends Controller
return view('website.product', compact('pro', 'cat', 'comments'));
}
public function productLang($lang, $pro)
{
return $this->product($pro);
}
public function searchAjax(Request $request)
{
if (!$request->has('q') || mb_strlen(trim($request->q)) < 3) {
@ -190,6 +200,11 @@ class WebsiteController extends Controller
return ['OK' => true, 'data' => $pros];
}
public function searchLang($lang, $term, Request $request)
{
return $this->search($term, $request);
}
public function search(Request $request)
{
if (!$request->has('q') || mb_strlen(trim($request->q)) < 3) {
@ -223,6 +238,16 @@ class WebsiteController extends Controller
return view('website.post', compact('post', 'comments', 'sld'));
}
public function postLang($lang, Post $post)
{
return $this->post($post);
}
public function galleryLang($lang, Gallery $gallery)
{
return $this->gallery($gallery);
}
public function gallery(Gallery $gallery)
{
$title = $gallery->title;
@ -248,6 +273,11 @@ class WebsiteController extends Controller
}
public function tagLang($lang, $tag)
{
return $this->tag($tag);
}
public function tag($tag)
{
$title = __('Tag') . ' ' . $tag;
@ -264,6 +294,11 @@ class WebsiteController extends Controller
return view('website.posts', compact('posts', 'title', 'subtitle'));
}
public function categoryLang($lang, Category $category)
{
return $this->category($category);
}
public function posts()
{
$title = __('All posts');
@ -274,22 +309,31 @@ class WebsiteController extends Controller
}
public function like(Post $news, Request $request)
public function likeLang($lang, Post $post, Request $request)
{
return $this->like($post, $request);
}
if (!gLog(Post::class, $news->id, 'like', $request)) {
return ['OK' => false, 'msg' => __("You liked ago ") . $news->title];
public function like(Post $post, Request $request)
{
if (!gLog(Post::class, $post->id, 'like', $request)) {
return ['OK' => false, 'msg' => __("You liked ago ") . $post->title];
}
if ($request->input('action') == 1) {
$news->increment('like');
return ['OK' => true, 'msg' => __("You liked ") . $news->title];
$post->increment('like');
return ['OK' => true, 'msg' => __("You liked ") . $post->title];
} else {
$news->increment('dislike');
return ['OK' => true, 'msg' => __("You disliked ") . $news->title];
$post->increment('dislike');
return ['OK' => true, 'msg' => __("You disliked ") . $post->title];
}
}
public function voteLang($lang ,Poll $poll, Request $request){
return $this->vote($poll,$request);
}
public function vote(Poll $poll, Request $request)
{
@ -305,6 +349,9 @@ class WebsiteController extends Controller
}
public function pollLang($lang, Poll $poll, Request $request){
return $this->poll($poll,$request);
}
public function poll(Poll $poll, Request $request)
{
$count = $poll->opinions()->sum('vote');
@ -313,6 +360,11 @@ class WebsiteController extends Controller
}
public function commentPostLang($lang, Post $post, CommentClientRequest $request)
{
return $this->commentPost($post, $request);
}
public function commentPost(Post $post, CommentClientRequest $request)
{
@ -352,6 +404,12 @@ class WebsiteController extends Controller
}
public function commentProductLang($lang, Product $product, CommentClientRequest $request)
{
return $this->commentProduct($product, $request);
}
public function commentProduct(Product $product, CommentClientRequest $request)
{
@ -391,6 +449,9 @@ class WebsiteController extends Controller
}
public function goadvLang($lang, Adv $adv){
return $this->goadv($adv);
}
public function goadv(Adv $adv)
{
$adv->increment('click');
@ -418,6 +479,11 @@ class WebsiteController extends Controller
return view('website.compare', compact('pros'));
}
public function compareAddLang($lang, Product $pro)
{
$this->compareAdd($pro);
}
public function compareRem(Product $pro)
{
$arr = unserialize(session('to_compare', serialize([])));
@ -428,6 +494,11 @@ class WebsiteController extends Controller
return redirect()->route('compare');
}
public function compareRemLang($lang, Product $pro)
{
return $this->compareRem($pro);
}
public function cardAdd($id)
{
$arr = unserialize(session('card', serialize([])));
@ -439,6 +510,16 @@ class WebsiteController extends Controller
return ['OK' => true, 'msg' => __('Added to card'), 'data' => count(array_merge($arr, $arr2))];
}
public function cardAddLang($lang, $id)
{
return $this->cardAdd($id);
}
public function cardAddQLang($lang, $id, $count)
{
return $this->cardAddQ($id, $count);
}
public function cardAddQ($id, $count)
{
$arr = unserialize(session('qcard', serialize([])));
@ -453,6 +534,11 @@ class WebsiteController extends Controller
return ['OK' => true, 'msg' => __('Added to card'), 'data' => count(array_merge($arr, $arr2))];
}
public function cardRemLang($lang, $id)
{
return $this->cardRem($id);
}
public function cardRem($id)
{
$arr = unserialize(session('card', serialize([])));
@ -463,6 +549,11 @@ class WebsiteController extends Controller
return redirect()->route('card.show')->with(['message' => __('Product removed form card')]);
}
public function cardRemQLang($lang, $id)
{
return $this->cardRemQ($id);
}
public function cardRemQ($id)
{
$arr = unserialize(session('qcard', serialize([])));
@ -485,13 +576,13 @@ class WebsiteController extends Controller
$counts = unserialize(session('qcounts', serialize([])));
$qpros = Quantity::whereIn('id', $arr)->get();
$transports = Transport::orderBy('sort')->orderBy('price')->get();
$resevers = Invoice::where('reserve',1)->where('customer_id', \auth('customer')->id())
$resevers = Invoice::where('reserve', 1)->where('customer_id', \auth('customer')->id())
->whereBetween('created_at',
[
Carbon::now()->subHour((int)getSetting('reserve')),
Carbon::now(),
])->get();
\Session::put('shoping_card','1');
\Session::put('shoping_card', '1');
\Session::save();
return view('website.card', compact('pros', 'transports', 'qpros', 'counts', 'resevers'));
}
@ -553,11 +644,11 @@ class WebsiteController extends Controller
$mobile = $request->mobile;
if (Customer::where('mobile', $mobile)->count() > 0) {
if (Customer::where('mobile', $mobile)->where('code', $code)->count() > 0){
if (Customer::where('mobile', $mobile)->where('code', $code)->count() > 0) {
Auth::guard('customer')->loginUsingId(Customer::where('mobile', $mobile)
->where('code', $code)->first()->id);
return ['OK' => true, 'msg' => __('Welcome')];
}else{
} else {
return ['OK' => false, 'err' => __('Auth code error')];
}
// login
@ -613,6 +704,11 @@ class WebsiteController extends Controller
return view('website.track', compact('attaches'));
}
public function favToggleLang($lang, Product $product)
{
return $this->favToggle($product);
}
public function favToggle(Product $product)
{
if (\auth('customer')->check()) {
@ -657,19 +753,21 @@ class WebsiteController extends Controller
}
static public function resetStockStatus(){
static public function resetStockStatus()
{
Product::whereStockQuantity('0')->update(['stock_status' => 'OUT_STOCK']);
return 'Done!';
}
static public function resetQuantity(){
static public function resetQuantity()
{
$qs = Quantity::groupBy('product_id')
$qs = Quantity::groupBy('product_id')
->select('product_id', DB::raw('sum(`count`) as count'))
->get();
foreach ($qs as $q){
foreach ($qs as $q) {
$p = Product::whereId($q->product_id)->first();
if ($p != null){
if ($p != null) {
$p->stock_quantity = $q->count;
$p->save();
}

@ -66,5 +66,6 @@ class Kernel extends HttpKernel
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class,
'under' => \App\Http\Middleware\UnderConstruction::class,
'lang' => \App\Http\Middleware\LangHandle::class,
];
}

@ -0,0 +1,24 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\URL;
class LangHandle
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
public function handle(Request $request, Closure $next)
{
app()->setLocale($request->route('lang'));
return $next($request);
}
}

@ -9,6 +9,8 @@ use Spatie\Image\Manipulations;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
use Spatie\Translatable\HasTranslations;
/**
* App\Models\Cat
@ -57,7 +59,10 @@ use Spatie\MediaLibrary\MediaCollections\Models\Media;
*/
class Cat extends Model implements HasMedia
{
use HasFactory, SoftDeletes, InteractsWithMedia;
use HasFactory, SoftDeletes, InteractsWithMedia,HasTranslations;
public $translatable = ['name','description'];
public function registerMediaConversions(Media $media = null): void
{

@ -12,6 +12,7 @@ use Spatie\Image\Manipulations;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
use Spatie\Translatable\HasTranslations;
use Xmen\StarterKit\Models\Category;
use Xmen\StarterKit\Models\Comment;
use function App\Helpers\getSetting;
@ -123,11 +124,13 @@ use function App\Helpers\getSetting;
*/
class Product extends Model implements HasMedia
{
use SoftDeletes, InteractsWithMedia, Taggable, Metable, HasFactory;
use SoftDeletes, InteractsWithMedia, Taggable, Metable, HasFactory,HasTranslations;
protected $guarded = [];
protected $appends = ['url'];
public $translatable = ['name','excerpt','description'];
public function getTitle()
{
return $this->name . getSetting('prefix') . $this->id;

@ -5,6 +5,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Spatie\Translatable\HasTranslations;
/**
* App\Models\Prop
@ -52,10 +53,12 @@ use Illuminate\Database\Eloquent\SoftDeletes;
*/
class Prop extends Model
{
use HasFactory,SoftDeletes;
use HasFactory, SoftDeletes, HasTranslations;
protected $guarded = [];
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
public $translatable = ['label'];
public function category()
{

@ -4,6 +4,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Spatie\Translatable\HasTranslations;
/**
* App\Models\Setting
@ -33,5 +34,7 @@ use Illuminate\Database\Eloquent\Model;
*/
class Setting extends Model
{
use HasFactory;
use HasFactory,HasTranslations;
public $translatable = ['value'];
}

@ -34,7 +34,7 @@
"psr/log": "v2.*",
"symfony/dom-crawler": "^6.2",
"symfony/psr-http-message-bridge": "^7.0",
"xmen/starter-kit": "^v3.1.0"
"xmen/starter-kit": "^v3.2.5"
},
"require-dev": {
"barryvdh/laravel-ide-helper": "^2.12",

1003
composer.lock generated

File diff suppressed because it is too large Load Diff

@ -95,6 +95,7 @@ return [
'locale' => 'fa',
'xlang' => env('XLANG',false),
'xlang_main' => env('XLANG_MAIN','en'),
'xlang_api_url' => env('XLANG_API_URL','en'),
/*
|--------------------------------------------------------------------------

@ -4,7 +4,7 @@ use Translator\Framework\LaravelConfigLoader;
use Translator\Infra\LaravelJsonTranslationRepository;
return [
'languages' => ["fa","ru","ar"],
'languages' => ["fa","ru"],
'directories' => [
app_path(),
resource_path('views'),

@ -16,7 +16,7 @@ return new class extends Migration
Schema::create('props', function (Blueprint $table) {
$table->id();
$table->string('name',90)->unique();
$table->string('label',90);
$table->string('label');
$table->string('width',300)->default('col-md-6');
$table->boolean('required')->default(false);
$table->boolean('searchable')->default(true);

@ -0,0 +1,52 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::table('posts', function ($table) {
$table->text('title')->change();
});
Schema::table('categories', function ($table) {
$table->text('name')->change();
});
Schema::table('cats', function ($table) {
$table->text('name')->change();
});
Schema::table('products', function ($table) {
$table->text('name')->change();
});
Schema::table('props', function ($table) {
$table->text('label')->change();
});
Schema::table('galleries', function ($table) {
$table->text('title')->change();
});
Schema::table('menu_items', function ($table) {
$table->text('title')->change();
});
Schema::table('images', function ($table) {
$table->text('title')->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
};

@ -36,7 +36,6 @@ class DatabaseSeeder extends Seeder
CatSeeder::class,
]);
if (env('NO_SEED_PRODUCT', 'false') != 'true') {
$this->call([
PostSeeder::class,
MenuSeeder::class,
@ -45,12 +44,13 @@ class DatabaseSeeder extends Seeder
// InvoiceSeeder::class,
// SliderSeeder::class,
]);
$this->call([
CustomerSeeder::class,
SettingSeeder::class,
MenuSeeder::class,
]);
}
$this->call([
CustomerSeeder::class,
SettingSeeder::class,
MenuSeeder::class,
]);
}
}

@ -14,6 +14,48 @@ class SettingSeeder extends Seeder
*/
public function run()
{
if (config('app.xlang')){
$lang = config('app.xlang_main');
\DB::insert(<<<SQL
INSERT INTO `settings` (`id`, `section`, `type`, `title`, `active`, `key`, `value`, `created_at`, `updated_at`) VALUES
(NULL, '1menu', 'image', 'لوگو', 1, 'logo_png', NULL, '2022-08-02 00:14:57', '2022-08-02 00:14:57'),
(NULL, '2top', 'text', 'عنوان قسمت اصلی', 1, 'top1text', '{"$lang":"\\u062a\\u0633\\u062a","ru":"\\u0442\\u0435\\u0441\\u0442"}', '2022-08-02 00:23:04', '2024-02-06 03:17:09'),
(NULL, '2top', 'cat', 'دسته قسمت اصلی', 1, 'top1cat', '{"$lang":"1"}', '2022-08-02 00:23:35', '2022-08-02 00:53:57'),
(NULL, '2top', 'text', 'عنوان قسمت بالا', 1, 'top2text', '{"$lang":"33%"}', '2022-08-02 00:23:04', '2024-02-06 03:14:33'),
(NULL, '2top', 'cat', 'دسته قسمت بالا', 1, 'top2cat', '{"$lang":"1"}', '2022-08-02 00:23:35', '2022-08-02 00:54:06'),
(NULL, '2top', 'text', 'عنوان قسمت پایین', 1, 'top3text', '{"$lang":"15%"}', '2022-08-02 00:23:04', '2024-02-06 03:14:33'),
(NULL, '2top', 'cat', 'دسته قسمت پایین', 1, 'top3cat', '{"$lang":"1"}', '2022-08-02 00:23:35', '2022-08-02 00:54:06'),
(NULL, '3top', 'text', 'عنوان قسمت دوم', 1, 'sectext', '{"$lang":"\\u0633\\u0627\\u06cc\\u0631 \\u0645\\u062d\\u0635\\u0648\\u0644\\u0627\\u062a"}', '2022-08-02 00:23:04', '2024-02-06 03:14:33'),
(NULL, '3top', 'cat', 'دسته قسمت دوم', 1, 'seccat', '{"$lang":"1"}', '2022-08-02 00:23:35', '2022-08-02 00:54:06'),
(NULL, '4sec', 'text', 'عنوان قسمت سوم فیلتر دار', 1, '3text', '{"$lang":"\\u0644\\u0648\\u0627\\u0632\\u0645 \\u062c\\u0627\\u0646\\u0628\\u06cc"}', '2022-08-02 00:33:47', '2024-02-06 03:14:33'),
(NULL, '4sec', 'cat', 'دسته قسمت سوم فیلتر دار', 1, '3cat', '{"$lang":"1"}', '2022-08-02 00:34:35', '2022-08-02 00:54:06'),
(NULL, '5sec', 'cat', 'دسته برند', 1, '4cat', '{"$lang":"1"}', '2022-08-02 00:34:35', '2022-08-02 00:54:06'),
(NULL, '6footer', 'category', 'دسته فوتر سمت راست', 1, 'footer1', '{"$lang":"1"}', '2022-08-02 00:38:10', '2022-08-02 00:54:06'),
(NULL, '6footer', 'category', 'فوتر وسط', 1, 'footer2', '{"$lang":"4"}', '2022-08-02 00:38:42', '2022-09-12 01:27:55'),
(NULL, '6footer', 'code', 'فوتر سمت راست', 1, 'footer3', '{"$lang":"<img src=\\"http:\\/\\/parsavps.com\\/enamad.png\\" width=\\"145px\\" \\/>"}', '2022-08-02 00:40:14', '2024-02-06 03:14:33'),
(NULL, '6footer', 'text', 'شبکه اجتماعی ایستاگرام', 1, 'soc_in', '{"$lang":null}', '2022-08-02 00:41:20', '2024-02-06 03:14:33'),
(NULL, '6footer', 'text', 'شبکه اجتماعی تلگرام', 1, 'soc_tg', '{"$lang":null}', '2022-08-02 00:41:20', '2024-02-06 03:14:33'),
(NULL, '6footer', 'text', 'شبکه اجتماعی توییتر', 1, 'soc_tw', '{"$lang":"https:\\/\\/twitter.com\\/a1gard"}', '2022-08-02 00:41:20', '2024-02-06 03:14:33'),
(NULL, '6footer', 'text', 'شبکه اجتماعی واستاپ (شماره با کد کشور)', 1, 'soc_wp', '{"$lang":"+989121234567"}', '2022-08-02 00:41:20', '2024-02-06 03:14:33'),
(NULL, '6footer', 'text', 'شبکه اجتماعی یوتویب', 1, 'soc_yt', '{"$lang":null}', '2022-08-02 00:41:20', '2024-02-06 03:14:33'),
(NULL, '6footer', 'text', 'عنوان فوتر', 1, 'footer_title', '{"$lang":"\\u0627\\u0637\\u0644\\u0627\\u0639\\u0627\\u062a \\u062a\\u0645\\u0627\\u0633"}', '2022-08-02 00:41:20', '2024-02-06 03:14:33'),
(NULL, '6footer', 'editor', 'نوشته فوتر', 1, 'footer_text', '{"$lang":"<p>\\u0627\\u0641\\u0631\\u0627\\u062f \\u06af\\u0631\\u0648\\u0647 \\u0633\\u0648\\u0645 \\u0627\\u0632 \\u0627\\u0647\\u0645\\u06cc\\u062a \\u0628\\u0647 \\u067e\\u0627\\u06cc\\u0627\\u0646 \\u0631\\u0633\\u0627\\u0646\\u062f\\u0646 \\u0622\\u06af\\u0627\\u0647 \\u0647\\u0633\\u062a\\u0646\\u062f. \\u0622\\u0646\\u0647\\u0627 \\u0628\\u0627 \\u062a\\u0641\\u06a9\\u0631 \\u0645\\u0646\\u0637\\u0642\\u06cc\\u060c \\u0637\\u0631\\u062d\\u06cc \\u0631\\u0648\\u0634\\u0646 \\u0627\\u0631\\u0627\\u0626\\u0647 \\u0645\\u06cc&zwnj;\\u06a9\\u0646\\u0646\\u062f. \\u0622\\u0646\\u0647\\u0627 \\u0646\\u0647 \\u062a\\u0646\\u0647\\u0627 \\u0628\\u0631\\u0627\\u06cc \\u067e\\u0627\\u06cc\\u0627\\u0646 \\u062f\\u0627\\u062f\\u0646 \\u0628\\u0647 \\u067e\\u0631\\u0648\\u0698\\u0647&zwnj;\\u06cc \\u062e\\u0648\\u062f \\u062f\\u0631 \\u0622\\u06cc\\u0646\\u062f\\u0647 \\u0628\\u0631\\u0646\\u0627\\u0645\\u0647 \\u0631\\u06cc\\u0632\\u06cc \\u0645\\u06cc&zwnj;\\u06a9\\u0646\\u0646\\u062f\\u060c \\u0628\\u0644\\u06a9\\u0647 \\u0628\\u0647 \\u062a\\u0645\\u0627\\u0645 \\u0646\\u062a\\u0627\\u06cc\\u062c \\u0648 \\u0639\\u0648\\u0627\\u0642\\u0628 \\u0627\\u062c\\u0631\\u0627\\u06cc \\u0622\\u0646 \\u0628\\u0631\\u0646\\u0627\\u0645\\u0647 \\u0647\\u0645 \\u0645\\u06cc&zwnj;\\u0627\\u0646\\u062f\\u06cc\\u0634\\u0646\\u062f. \\u0627\\u06cc\\u0646 \\u0627\\u0641\\u0631\\u0627\\u062f \\u06a9\\u0633\\u0627\\u0646\\u06cc \\u0647\\u0633\\u062a\\u0646\\u062f \\u06a9\\u0647 \\u0647\\u0646\\u0631 \\u0628\\u0647 \\u067e\\u0627\\u06cc\\u0627\\u0646 \\u0631\\u0633\\u0627\\u0646\\u062f\\u0646 \\u0631\\u0627 \\u0645\\u06cc&zwnj;\\u062f\\u0627\\u0646\\u0646\\u062f.<\\/p>"}', '2022-08-02 00:41:20', '2024-02-06 03:14:33'),
(NULL, '7seo', 'text', 'کد رنگ سایت', 1, 'color', '{"$lang":"#3593D2"}', '2022-08-02 00:48:38', '2024-02-06 03:14:33'),
(NULL, '7seo', 'text', 'سئو کلمات کلیدی', 1, 'keywords', '{"$lang":"\\u0641\\u0631\\u0648\\u0634\\u06af\\u0627\\u0647\\u060c \\u0641\\u0631\\u0648\\u0634 \\u0622\\u0646\\u0644\\u0627\\u06cc\\u0646"}', '2022-08-02 00:49:10', '2024-02-06 03:14:33'),
(NULL, '7seo', 'text', 'سئو جزئیات', 1, 'desc', '{"$lang":"\\u062a\\u0648\\u0636\\u06cc\\u062d\\u0627\\u062a \\u0641\\u0631\\u0648\\u0634\\u06af\\u0627\\u0647 \\u0634\\u0645\\u0627"}', '2022-08-02 00:50:08', '2024-02-06 03:14:33'),
(NULL, '7seo', 'text', 'متن کپی رایت', 1, 'copyright', '{"$lang":"\\u06a9\\u0644\\u06cc\\u0647 \\u062d\\u0642\\u0648\\u0642 \\u0628\\u0631\\u0627\\u06cc \\u0648\\u0628\\u0633\\u0627\\u06cc\\u062a \\u0641\\u0631\\u0648\\u0634\\u06af\\u0627\\u0647 \\u0645\\u062d\\u0641\\u0648\\u0638 \\u0627\\u0633\\u062a"}', '2022-08-02 01:10:18', '2024-02-06 03:14:33'),
(NULL, '1menu', 'text', 'تلفن', 1, 'tel', '{"$lang":"021"}', '2023-02-22 20:51:33', '2024-02-06 03:14:33'),
(NULL, '1menu', 'text', 'ایمیل', 1, 'email', '{"$lang":"info@local"}', '2023-02-22 20:51:53', '2024-02-06 03:14:33'),
(NULL, 'seo', 'text', 'نام سایت', 1, 'site_name', '{"$lang":"\\u0641\\u0631\\u0648\\u0634\\u06af\\u0627\\u0647 \\u0627\\u06cc\\u06a9\\u0633 \\u0634\\u0627\\u067e"}', '2022-09-14 05:16:58', '2024-02-06 03:14:33'),
(NULL, 'seo', 'text', 'توضیح کوتاه سایت(SEO)', 1, 'site_description', '{"$lang":"\\u0628\\u0647 \\u0631\\u0648\\u0632\\u062a\\u0631\\u06cc\\u0646 \\u06af\\u0648\\u0634\\u06cc \\u0647\\u0627 \\u0628\\u0627 \\u06a9\\u0645\\u062a\\u0631\\u06cc\\u0646 \\u0642\\u06cc\\u0645\\u062a"}', '2022-09-14 05:18:23', '2024-02-06 03:14:33'),
(NULL, 'seo', 'text', 'کلمات کلیدی سایت (SEO- با کاما از هم جدا کنید)', 1, 'site_keywords', '{"$lang":"\\u06af\\u0648\\u0634\\u06cc\\u060c\\u0627\\u0631\\u0632\\u0627\\u0646\\u060c\\u062e\\u0631\\u06cc\\u062f\\u060c\\u0627\\u06cc\\u06a9\\u0633 \\u0634\\u0627\\u067e"}', '2022-09-14 05:22:56', '2024-02-06 03:14:33'),
(NULL, 'seo', 'text', 'کد گوگل وب مستر', 1, 'site_webmaster_google', '{"$lang":null}', '2022-09-14 05:29:17', '2024-02-06 03:14:33'),
(NULL, 'seo', 'image', 'تصویر سایت(SEO)', 1, 'site_image', NULL, '2022-09-14 05:30:51', '2022-09-14 05:30:51');
SQL);
}else{
//
\DB::insert(<<<SQL
REPLACE INTO `settings` (`id`, `section`, `type`, `title`, `active`, `key`, `value`, `created_at`, `updated_at`) VALUES
@ -56,5 +98,6 @@ values (null, 'seo', 'text', 'نام سایت', 1, 'site_name', 'فروشگاه
(null, 'seo', 'image', 'تصویر سایت(SEO)', 1, 'site_image', null, '2022-09-14 10:00:51', '2022-09-14 10:00:51');
SQL
);
}
}
}

@ -17,10 +17,10 @@ class XlangSeeder extends Seeder
{
//
$lang = new Xlang();
$lang->tag = 'fa';
$lang->rtl = true;
$lang->tag = config('app.xlang_main');
$lang->rtl = true;
$lang->is_default = true;
$lang->name = 'پارسی';
$lang->name = __("Default");
$lang->save();
}
}

@ -3734,6 +3734,63 @@ nav a {
color: rgba(255, 255, 255, 0.3333333333);
}
.lang-support {
background: dodgerblue;
color: white;
padding: 7px;
text-align: center;
font-weight: 300;
margin-top: 1rem;
}
.btn-ai {
height: 65px;
width: 65px;
background: dodgerblue;
font-size: 25px;
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: auto;
transition: 400ms;
cursor: pointer;
box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0.1333333333);
}
.btn-ai:hover {
box-shadow: inset 0 0 0 75px rgba(0, 0, 0, 0.1333333333);
}
.btn-add {
height: 50px;
width: 50px;
background: #333;
font-size: 25px;
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
transition: 400ms;
cursor: pointer;
box-shadow: inset 0 0 0 0 rgba(255, 255, 255, 0.1333333333);
position: fixed;
left: 1rem;
bottom: 1rem;
text-decoration: none;
}
.btn-add:hover {
box-shadow: inset 0 0 0 75px rgba(0, 0, 0, 0.1333333333);
}
.img-squire {
width: 100%;
height: 175px;
-o-object-fit: cover;
object-fit: cover;
}
/*-768px width*/
@media (max-width: 1000px) {
.gird4 {
@ -3800,3 +3857,7 @@ nav a {
right: auto !important;
left: 2rem !important;
}
.no-dec a {
text-decoration: none;
}

@ -26,7 +26,9 @@
":app Dear customer Your :product signed for you.": ":app\nکاربر گرامی محصول «:product» برای شما ثبت شد.",
"A fresh verification link has been sent to your email address.": "یک لینک تاییده برای شما ایمیل شد",
"ACL": "سطح دسترسی",
"AI translate form original source": "",
"ANSWERED": "پاسخ‌ داده شده",
"API error!": "",
"Action": "عملیات",
"Actions": "عملیات",
"Active": "فعال",
@ -153,6 +155,7 @@
"Deactivate": "غیرفعال",
"Deactive": "غیرفعال",
"Dear customer, Please complete your information": "مشتری عزیز، لطفا اطلاعات خود را تکمیل کنید",
"Default": "",
"Delete": "حذف",
"Description": "توضیحات",
"Description Text": "توضیحات کامل",
@ -172,7 +175,7 @@
"Draft": "پیش‌نویس",
"Draft now": "پیش‌نویس کن",
"Drafted": "پیش‌نویس شده",
"E-Mail Address": "رایانامه|ایمیل",
"E-Mail Address": "رایانامه\/ایمیل",
"Edit": "ویرایش",
"Edit Discount": "ویرایش تخفیف",
"Edit Menu": "ویرایش منو",
@ -275,16 +278,18 @@
"Magazine": "مجله",
"Main address": "آدرس اصلی",
"Main category": "سرفصل اصلی",
"Main language content": "",
"Main product category": "دسته اصلی محصول",
"Manage": "مدیریت",
"Max click": "حداکثر تعداد کلیک",
"Menu": "منو",
"Menus": "منو",
"Menus list": "فهرست منو ها",
"Menu": "فهرست\/منو",
"Menus": "فهرست‌ها",
"Menus list": "فهرست منوها",
"Menus preview": "پیش نمایش منو",
"Message": "پیام",
"Metas and publish": "ویژگی ها و انتشار",
"Mobile": "موبایل",
"Model": "",
"Monday": "دوشنبه",
"Multi level select type": "نوع چند مرحله ای",
"Multi select type": "نوع انتخالی چند گانه",
@ -415,8 +420,8 @@
"Quantity": "موجودی",
"Question": "سوال",
"Question \/ Answer": "سوال \/ جواب",
"Question\/Message": "سوال \/ پیام",
"Questions": "سوال‌ها",
"Question|Message": "سوال \/ پیام",
"RTL": "راست به چپ",
"Radio type": "نوع دکه رادیو",
"Ref ID": "",
@ -508,6 +513,7 @@
"Total amount": "مقدار کل",
"Tracking code": "کد رهگیری",
"Translate": "ترجمان",
"Translate model": "",
"Translate updated": "ترجمه به روز شد",
"Translate with AI": "ترجمه با کمک هوش مصنوعی",
"Translated by ai xstack service:": "",
@ -534,6 +540,7 @@
"Username": "نام کاربری",
"Users": "کاربران",
"Users list": "فهرست کاربران",
"Value": "",
"Verify Your Email Address": "تایید رایانامه یا ایمیل خود",
"Video clip": "ویدئو کلیپ",
"Video clips": "کلیپ ها",
@ -597,7 +604,7 @@
"logs": "لاگ کاربران",
"menu": "منو",
"minute": "دقیقه",
"name \/ email": "نام | ایمیل",
"name \/ email": "نام \/ ایمیل",
"not Required": "غیر ضروری",
"not searchable": "غیر قابل سرچ",
"one second ago": " یک ثانیه پیش",

@ -0,0 +1,490 @@
{
" Property edit": "",
" created": "",
" deleted": "",
" edited": "",
"$log->action": "",
":app Dear customer Your :product signed for you.": "",
"A fresh verification link has been sent to your email address.": "",
"AI translate form original source": "",
"API error!": "",
"Action": "",
"Actions": "",
"Active": "",
"Active now": "",
"Add": "",
"Add address": "",
"Add new setting": "",
"Add to setting": "",
"Added to card": "",
"Address": "",
"Address removed": "",
"Address saved": "",
"Addresses": "",
"Admin": "",
"Advanced information": "",
"Advertise": "",
"Advertise list": "",
"All": "",
"All posts": "",
"Alternative address": "",
"Amount": "",
"Answer": "",
"Application request": "",
"Approve": "",
"Approved": "",
"Are you sure to remove?": "",
"Attached": "",
"Attachment": "",
"Attachment removed": "",
"Attachments": "",
"Auth code error": "",
"Back order": "",
"Base price": "",
"Basic information": "",
"Before proceeding, please check your email for a verification link.": "",
"Belong to": "",
"Body": "",
"Bulk action": "",
"By percent": "",
"By price": "",
"CLOSED": "",
"Call us!": "",
"Canceled": "",
"Card cleared": "",
"Cat": "",
"Catalog": "",
"Categories": "",
"Categories deleted successfully": "",
"Categories list": "",
"Categories node": "",
"Category": "",
"Category Parent": "",
"Category name": "",
"Category with Sub Category": "",
"Category with sub posts": "",
"Check discount": "",
"Checkbox": "",
"Checkbox type": "",
"Choose a image to upload": "",
"Choose one": "",
"City": "",
"Click": "",
"Click here to upload or drag and drop here": "",
"Clip": "",
"Clip list": "",
"Clips": "",
"Code": "",
"Colleague": "",
"Color type": "",
"Comments": "",
"Compare products": "",
"Complete your purchase": "",
"Completed": "",
"Confirm Password": "",
"Contact list": "",
"Contact us": "",
"ContactUs": "",
"Contacts": "",
"Count": "",
"Cover": "",
"Create adv": "",
"Create clip": "",
"Create poll": "",
"Create slider": "",
"Create user": "",
"Created At": "",
"Credit": "",
"Credit applied": "",
"Customer": "",
"Customer created successfully": "",
"Customer deleted successfully": "",
"Customer profile": "",
"Customer updated successfully": "",
"Customers": "",
"Customers deleted successfully": "",
"Customers list": "",
"Dashboard": "",
"Date": "",
"Deactive": "",
"Dear customer, Please complete your information": "",
"Default": "",
"Delete": "",
"Description": "",
"Description Text": "",
"Direct link": "",
"Direction": "",
"Discount": "",
"Discount code": "",
"Discount code incorrect": "",
"Discount code accepted": "",
"Discounts": "",
"Discounts list": "",
"Do": "",
"Double click on image to change index image": "",
"Double click on to remove item": "",
"Download json file": "",
"Draft": "",
"Draft now": "",
"Drafted": "",
"E-Mail Address": "",
"Edit": "",
"Edit Discount": "",
"Edit Menu": "",
"Edit Post": "",
"Edit Product": "",
"Edit adv": "",
"Edit category": "",
"Edit clip": "",
"Edit customer": "",
"Edit discount": "",
"Edit invoice": "",
"Edit language": "",
"Edit poll": "",
"Edit product": "",
"Edit product category": "",
"Edit slider": "",
"Edit ticket": "",
"Edit transport": "",
"Edit user": "",
"Editor text": "",
"Email": "",
"Email Address": "",
"Empty title": "",
"Excerpt": "",
"Expire": "",
"Expire date": "",
"Expire date": "",
"Failed": "",
"False": "",
"Favorites": "",
"File": "",
"Filter": "",
"Finish and save": "",
"Flag": "",
"Forgot Your Password?": "",
"Free": "",
"Friday": "",
"From": "",
"Full name": "",
"Galleries": "",
"Galleries list": "",
"Gallery": "",
"Gallery list": "",
"Gram(s)": "",
"Hello": "",
"Icon": "",
"If you did not receive the email": "",
"If you have any description about your order write here...": "",
"Image": "",
"Images": "",
"In stock": "",
"Inactive now": "",
"Incorrect mobile number": "",
"Index image": "",
"Information": "",
"Invalid json file!": "",
"Invalid search": "",
"Invoice": "",
"Invoice id": "",
"Invoice payed.": "",
"Invoice status": "",
"Invoices": "",
"Invoices deleted successfully": "",
"Invoices list": "",
"Invoices status changed successfully": "",
"Is breaking news?": "",
"Is default": "",
"Is effective price?": "",
"Key": "",
"LTR": "",
"Label": "",
"Lang": "",
"Language list": "",
"Languages": "",
"Languages translate": "",
"Last update": "",
"Link": "",
"Login": "",
"Login \/ Register": "",
"Logout": "",
"Logs": "",
"Long text": "",
"Magazine": "",
"Main address": "",
"Main category": "",
"Main language content": "",
"Main product category": "",
"Manage": "",
"Max click": "",
"Menu": "",
"Menus": "",
"Menus list": "",
"Menus preview": "",
"Metas and publish": "",
"Mobile": "",
"Model": "",
"Monday": "",
"Multi select type": "",
"Name": "",
"Name and lastname": "",
"New Advertise": "",
"New Clip": "",
"New Customer": "",
"New Discount": "",
"New Gallery": "",
"New Invoice": "",
"New Poll": "",
"New Post": "",
"New Product": "",
"New Product category": "",
"New Property": "",
"New Slider": "",
"New Video": "",
"New category": "",
"New customer": "",
"New discount": "",
"New gallery": "",
"New invoice": "",
"New language": "",
"New menu": "",
"New product": "",
"New product category": "",
"New ticket": "",
"New transport": "",
"New user": "",
"Next": "",
"No": "",
"No parent": "",
"No product": "",
"Normal": "",
"Not required": "",
"Number type": "",
"Online": "",
"Option": "",
"Options": "",
"Order": "",
"Order type": "",
"Out stock": "",
"Page name": "",
"Parent": "",
"Password": "",
"Pay by credit": "",
"Payment Type": "",
"Payment error": "",
"Payment price:": "",
"Pediatric dental clips": "",
"Pending": "",
"Phone": "",
"Pictures": "",
"Pin": "",
"Please change payment gate.": "",
"Please confirm your password before continuing.": "",
"Poll": "",
"Poll list": "",
"Polls": "",
"Polls list": "",
"Post": "",
"Post Text": "",
"Post list": "",
"Post reply": "",
"Postal code": "",
"Posts": "",
"Posts search": "",
"Preview": "",
"Previous": "",
"Price": "",
"Price range": "",
"Print": "",
"Processing": "",
"Product": "",
"Product added to favorite": "",
"Product categories": "",
"Product categories list": "",
"Product categories node": "",
"Product category": "",
"Product category Parent": "",
"Product category created successfully": "",
"Product category deleted successfully": "",
"Product category name": "",
"Product category updated successfully": "",
"Product deleted successfully": "",
"Product invoice deleted successfully": "",
"Product invoice updated successfully": "",
"Product removed form card": "",
"Product removed from favorite": "",
"Product restore successfully": "",
"Product stock changed successfully": "",
"Products": "",
"Products list": "",
"Profile": "",
"Profile updated": "",
"Properties list": "",
"Properties meta": "",
"Properties sort": "",
"Props": "",
"Publish now": "",
"Published": "",
"Quantity": "",
"Question": "",
"Question \/ Answer": "",
"Question\/Message": "",
"Questions": "",
"RTL": "",
"Ref ID": "",
"Register": "",
"Register or login to complete purchase": "",
"Reject": "",
"Remember Me": "",
"Remove": "",
"Reply": "",
"Required": "",
"Reserve order for :H hours": "",
"Reset": "",
"Reset Password": "",
"Restore": "",
"Role": "",
"SKU": "",
"SMS Code": "",
"SMS send, Please login with you Auth code": "",
"Saturday": "",
"Save": "",
"Save sort": "",
"Search": "",
"Search for": "",
"Search in all panel": "",
"Searchable": "",
"Section": "",
"Select type": "",
"Send": "",
"Send Answer": "",
"Send Answer and close": "",
"Send Password Reset Link": "",
"Send new ticket": "",
"Setting": "",
"Setting added to website": "",
"Setting of website updated": "",
"Shopping card": "",
"Short text": "",
"Show": "",
"Signup or Login": "",
"Single Select & multi search": "",
"Slider": "",
"Slider list": "",
"Sliders": "",
"Sort": "",
"Sort category": "",
"Sort product category": "",
"Special quantity": "",
"State": "",
"Status": "",
"Stock quantity": "",
"Store": "",
"Sub invoices items": "",
"Subject": "",
"Subtitle": "",
"Sum": "",
"Sunday": "",
"Tag": "",
"Tag search": "",
"Tag with sub posts": "",
"Tagged by": "",
"Tags": "",
"Tax": "",
"Text": "",
"Text type": "",
"The first and\/or second image will be index image": "",
"The order is duplicate please check invoices list": "",
"Thumbnail": "",
"Thursday": "",
"Ticket answered successfully": "",
"Ticket has been sent": "",
"Tickets": "",
"Tickets deleted successfully": "",
"Tickets status changed successfully": "",
"Title": "",
"To": "",
"Toggle navigation": "",
"Total Price": "",
"Total amount": "",
"Tracking code": "",
"Translate model": "",
"Translate updated": "",
"Translate with AI": "",
"Translated by ai xstack service:": "",
"Translates": "",
"Transport": "",
"Transport method": "",
"Transport price": "",
"Transports": "",
"Transports list": "",
"Trashed": "",
"True": "",
"Try login": "",
"Tuesday": "",
"Type": "",
"Under construction": "",
"Unit": "",
"Unknown bulk action :": "",
"Upload file": "",
"Upload images": "",
"Upload new images": "",
"User": "",
"User list": "",
"Username": "",
"Users": "",
"Users list": "",
"Value": "",
"Verify Your Email Address": "",
"Video clip": "",
"Video clips": "",
"Video list": "",
"We call you about price soon.": "",
"Website contents": "",
"Wednesday": "",
"Welcome": "",
"Width": "",
"Yes": "",
"You are logged in!": "",
"You can choose one or more image together": "",
"You disliked ": "",
"You don't have any credit": "",
"You dont't have acccess this acction": "",
"You have got :count products in your basket, Could you complete your purchase?": "",
"You liked ": "",
"You liked ago ": "",
"You order reserved for a few hours, please pay to complete process": "",
"You voted ago ": "",
"You voted right now ": "",
"Your Email sent": "",
"Your authentication code": "",
"Your comment submited successfully, After approve will be visbile.": "",
"Your credit": "",
"Your invoices": "",
"Your message has been successfully sent.": "",
"Your message...": "",
"Your question has been sent, We answer it soon.": "",
"Your question or request...": "",
"action": "",
"body": "",
"by percent": "",
"by price": "",
"choose addrress": "",
"click here to request another": "",
"clip or cover not uploaded...": "",
"created successfully": "",
"deleted successfully": "",
"id": "",
"invoice created successfully": "",
"name \/ email": "",
"not searchable": "",
"password repeat": "",
"phone": "",
"postal_code": "",
"preview": "",
"reply": "",
"slider or cover not uploaded...": "",
"transports deleted successfully": "",
"updated successfully": "",
"weight": ""
}

@ -6,6 +6,8 @@
"$log->action": "$log->действие",
":app Dear customer Your :product signed for you.": ":app Уважаемый клиент, ваш :product подписан для вас.",
"A fresh verification link has been sent to your email address.": "На ваш адрес электронной почты была отправлена новая ссылка для подтверждения.",
"AI translate form original source": "",
"API error!": "",
"Action": "Действие",
"Actions": "Действия",
"Active": "Активный",
@ -50,6 +52,7 @@
"Call us!": "Позвоните нам!",
"Canceled": "Отменено",
"Card cleared": "Карта очищена",
"Cat": "",
"Catalog": "Каталог",
"Categories": "Категории",
"Categories deleted successfully": "Категории успешно удалены",
@ -68,6 +71,7 @@
"City": "Город",
"Click": "Нажмите",
"Click here to upload or drag and drop here": "Нажмите здесь для загрузки или перетащите сюда",
"Clip": "",
"Clip list": "Список клипов",
"Clips": "Клипы",
"Code": "Код",
@ -104,6 +108,7 @@
"Date": "Дата",
"Deactive": "Неактивный",
"Dear customer, Please complete your information": "Уважаемый клиент, пожалуйста, заполните информацию",
"Default": "",
"Delete": "Удалить",
"Description": "Описание",
"Description Text": "Текст описания",
@ -209,14 +214,17 @@
"Magazine": "«Журнал»",
"Main address": "«Основной адрес»",
"Main category": "Главная категория",
"Main language content": "",
"Main product category": "«Основная категория товаров»",
"Manage": "Управлять",
"Max click": "«Макс клик»",
"Menu": "",
"Menus": "«Меню»",
"Menus list": "«Список меню»",
"Menus preview": "«Предварительный просмотр меню»",
"Metas and publish": "«Метаинформация и публикация»",
"Mobile": "«Мобильный»",
"Model": "",
"Monday": "Понедельник",
"Multi select type": "«Множественный выбор типа»",
"Name": "Имя",
@ -315,13 +323,14 @@
"Properties list": "«Список свойств»",
"Properties meta": "«Мета свойства»",
"Properties sort": "«Сортировка свойств»",
"Props": "",
"Publish now": "«Опубликовать сейчас»",
"Published": "Опубликовано",
"Quantity": "Количество",
"Question": "Вопрос",
"Question \/ Answer": "Вопрос ответ",
"Question\/Message": "«Вопрос\/Сообщение»",
"Questions": "Вопросы",
"Question|Message": "«Вопрос|Сообщение»",
"RTL": "РТЛ",
"Ref ID": "«Реферальный идентификатор»",
"Register": "Регистр",
@ -400,6 +409,7 @@
"Total Price": "Итоговая цена",
"Total amount": "Общая сумма",
"Tracking code": "Код отслеживания",
"Translate model": "",
"Translate updated": "",
"Translate with AI": "",
"Translated by ai xstack service:": "",
@ -425,6 +435,7 @@
"Username": "Имя пользователя",
"Users": "«Пользователи»",
"Users list": "«Список пользователей»",
"Value": "",
"Verify Your Email Address": "Проверьте свой адрес электронной почты",
"Video clip": "Видеоклип",
"Video clips": "Видеоклипы",

@ -183,6 +183,63 @@ nav {
color: #ffffff55;
}
.lang-support{
background: dodgerblue;
color: white;
padding: 7px;
text-align: center;
font-weight: 300;
margin-top: 1rem;
}
.btn-ai{
height: 65px;
width: 65px;
background: dodgerblue;
font-size: 25px;
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: auto;
transition: 400ms;
cursor: pointer;
box-shadow: inset 0 0 0 0 #00000022;
&:hover{
box-shadow: inset 0 0 0 75px #00000022;
}
}
.btn-add{
height: 50px;
width: 50px;
background: #333;
font-size: 25px;
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
transition: 400ms;
cursor: pointer;
box-shadow: inset 0 0 0 0 #ffffff22;
position: fixed;
left: 1rem;
bottom: 1rem;
text-decoration: none;
&:hover{
box-shadow: inset 0 0 0 75px #00000022;
}
}
.img-squire{
width: 100%;
height: 175px;
object-fit: cover;
}
/*-768px width*/
@media ( max-width: 1000px ) {
.gird4 {
@ -250,3 +307,9 @@ nav {
right: auto !important;
left: 2rem !important;
}
.no-dec{
a{
text-decoration: none;
}
}

@ -26,8 +26,6 @@
</th>
<th>
{{__("Action")}}
<a href="{{route('admin.cat.create')}}" class="btn btn-success float-start"><i
class="fa fa-plus"></i></a>
</th>
</tr>
</thead>
@ -49,14 +47,18 @@
</td>
<td>
<a href="{{route('admin.cat.edit',$cat->slug)}}" class="btn btn-primary">
<i class="fa fa-edit"></i> &nbsp;
{{__("Edit")}}
<i class="ri-edit-2-line"></i>
</a>
<a href="{{route('admin.cat.delete',$cat->slug)}}"
class="btn btn-danger delete-confirm">
<i class="fa fa-times"></i> &nbsp;
{{__("Delete")}}
<i class="ri-close-line"></i>
</a>
@if(config('app.xlang'))
<a href="{{route('admin.lang.model',[$cat->id,\App\Models\Cat::class])}}"
class="btn btn-outline-dark translat-btn">
<i class="ri-translate"></i>
</a>
@endif
</td>
</tr>
@endforeach
@ -67,5 +69,8 @@
<div class="text-center pt-3">
{{$cats->links()}}
</div>
<a class="btn-add" href="{{route('admin.cat.create')}}">
<i class="ri-add-line"></i>
</a>
</div>
@endsection

@ -46,7 +46,7 @@
</tr>
<tr>
<th>
{{__("Question|Message")}}
{{__("Question/Message")}}
</th>
<td>
{{($con->body)}}

@ -49,7 +49,7 @@
<input name="img" type="file" class="form-control @error('img') is-invalid @enderror" id="flag" placeholder="{{__('Flag')}}" value="{{old('img',$xlang->img??null)}}" />
</div>
</div>
<div class="col-md-4 mt-3">
<div class="col-md-2 mt-3">
<div class="form-check form-switch mt-1">
<br>
<input class="form-check-input @error('rtl') is-invalid @enderror"
@ -60,6 +60,17 @@
</label>
</div>
</div>
<div class="col-md-2 mt-3">
<div class="form-check form-switch mt-1">
<br>
<input class="form-check-input @error('is_default') is-invalid @enderror"
name="is_default" type="checkbox" id="is_default" @if(old('is_default',$xlang->is_default??null) == 1) checked="" @endif
value="1" >
<label for="is_default">
{{__('Default')}}
</label>
</div>
</div>
<div class="col-12 mt-4">
<label> &nbsp; </label>
<input name="" id="" type="submit" class="btn btn-primary mt-2" value="{{__('Save')}}" />

@ -27,8 +27,7 @@
</th>
<th>
{{__("Action")}}
<a href="{{route('admin.lang.create')}}" class="btn btn-success btn-sm float-end"><i
class="fa fa-plus"></i></a>
</th>
</tr>
</thead>
@ -56,13 +55,11 @@
</td>
<td>
<a href="{{route('admin.lang.edit',$n->id)}}" class="btn btn-primary btn-sm">
<i class="fa fa-edit"></i> &nbsp;
{{__("Edit")}}
<i class="ri-edit-2-line"></i>
</a>
<a href="{{route('admin.lang.delete',$n->id)}}"
class="btn btn-danger delete-confirm btn-sm">
<i class="fa fa-times"></i> &nbsp;
{{__("Delete")}}
<i class="ri-close-line"></i>
</a>
</td>
</tr>
@ -74,5 +71,8 @@
<div class="text-center pt-3">
{{$langs->links()}}
</div>
<a class="btn-add" href="{{route('admin.lang.create')}}">
<i class="ri-add-line"></i>
</a>
</div>
@endsection

@ -0,0 +1,82 @@
@extends('admin.adminlayout')
@section('page_title')
{{__("Translate model")}}: {{($model->{$translates[0]})}}
-
@endsection
@section('content')
<div class="container">
@include('starter-kit::component.err')
<h3>
{{__("Translate model")}}: {{($model->{$translates[0]})}}
</h3>
<h4 class="lang-support">
{{__("Main language content")}}:({{config('app.xlang_main')}})
</h4>
<table class="table table-bordered">
<tr>
<th>
{{__("Title")}}
</th>
<th>
{{__("Value")}}
</th>
</tr>
@foreach($translates as $tr)
<tr>
<th>
{{$tr}}
</th>
<th>
{{($model->{$tr})}}
</th>
</tr>
@endforeach
</table>
<form action="{{route( 'admin.lang.modelSave',[$model->id,$cls])}}" method="post">
@csrf
@foreach($langs as $lang)
<h4 class="lang-support">
{{__("Translate model")}}: {{$lang->name}} ({{$lang->tag}})
</h4>
@foreach($translates as $tr)
<div class="form-group mt-2">
<label for="{{$lang->tag}}{{$tr}}">
{{$tr}}:
</label>
<div class="row">
<div class="col-md-10">
@if( $tr == 'body' || $tr == 'desc' || $tr == 'description' || $tr == 'excerpt' )
<textarea
class="form-control @if($tr == 'body' || $tr == 'desc' || $tr == 'description' ) ckeditorx @endif"
rows="4" id="{{$lang->tag}}{{$tr}}"
name="data[{{$lang->tag}}][{{$tr}}]">{{gettype($model->getTranslation($tr,$lang->tag)) == 'string' ? $model->getTranslation($tr,$lang->tag):'' }}</textarea>
@else
<input type="text" id="{{$lang->tag}}{{$tr}}" name="data[{{$lang->tag}}][{{$tr}}]"
value="{{gettype($model->getTranslation($tr,$lang->tag)) == 'string' ? $model->getTranslation($tr,$lang->tag):'' }}"
placeholder="" class="form-control">
@endif
</div>
<div class="col-md-2 d-flex align-items-center">
<a href="{{route('admin.lang.aiText',[$model->id,$cls,$lang->tag,$tr])}}" class="btn-ai" title="{{__("AI translate form original source")}}">
<i class="ri-translate"></i>
</a>
</div>
</div>
</div>
@endforeach
@endforeach
<button class="btn btn-outline-dark w-100 my-3">
{{__("Save")}}
</button>
</form>
</div>
@endsection

@ -9,9 +9,52 @@
@include('starter-kit::component.err')
<div class="text-center pt-3">
{{-- <div class="card my-3">--}}
{{-- <div class="card-header">--}}
{{-- {{__("Filter")}}--}}
{{-- </div>--}}
{{-- <form class="card-body text-start">--}}
{{-- <div class="row">--}}
{{-- <div class="col-md">--}}
{{-- <label for="lang">--}}
{{-- {{__("Lang")}}--}}
{{-- </label>--}}
{{-- <select name="lang" id="lang" class="form-control">--}}
{{-- <option value=""> {{__("All")}} </option>--}}
{{-- @foreach($langs as $lang)--}}
{{-- @if($lang->is_default == '0')--}}
{{-- <option value="{{$lang->id}}">--}}
{{-- {{$lang->name}}--}}
{{-- </option>--}}
{{-- @endif--}}
{{-- @endforeach--}}
{{-- </select>--}}
{{-- </div>--}}
{{-- <div class="col-md">--}}
{{-- <label for="lang">--}}
{{-- {{__("Model")}}--}}
{{-- </label>--}}
{{-- <select name="lang" id="lang" class="form-control">--}}
{{-- <option value=""> {{__("All")}} </option>--}}
{{-- <option value="Product"> {{__("Product")}} </option>--}}
{{-- <option value="Cat"> {{__("Cat")}} </option>--}}
{{-- <option value="Post"> {{__("Post")}} </option>--}}
{{-- <option value="Category"> {{__("Category")}} </option>--}}
{{-- <option value="Slider"> {{__("Slider")}} </option>--}}
{{-- <option value="Meta"> {{__("Props")}} </option>--}}
{{-- <option value="Clip"> {{__("Clip")}} </option>--}}
{{-- <option value="Gallery"> {{__("Gallery")}} </option>--}}
{{-- <option value="Menu"> {{__("Menu")}} </option>--}}
{{-- <option value="Setting"> {{__("Setting")}} </option>--}}
{{-- </select>--}}
{{-- </div>--}}
{{-- </div>--}}
{{-- </form>--}}
{{-- </div>--}}
<div class="row">
@foreach($langs as $lang)
<div class="col-md-4">
<div class="col-md-4 mb-4">
<div class="lang-item">
<h5>
{{$lang->name}}

@ -51,8 +51,6 @@
</th>
<th>
{{__("Action")}}
<a href="{{route('admin.product.create')}}" class="btn btn-success float-end"><i
class="fa fa-plus"></i></a>
</th>
</tr>
</thead>
@ -78,15 +76,19 @@
</td>
<td>
<a href="{{route('admin.product.edit',$n->slug)}}" class="btn btn-primary">
<i class="fa fa-edit"></i> &nbsp;
{{__("Edit")}}
<i class="ri-edit-2-line"></i>
</a>
@if($n->deleted_at == null)
<a href="{{route('admin.product.delete',$n->slug)}}"
class="btn btn-danger delete-confirm">
<i class="fa fa-times"></i> &nbsp;
{{__("Delete")}}
<i class="ri-close-line"></i>
</a>
@if(config('app.xlang'))
<a href="{{route('admin.lang.model',[$n->id,\App\Models\Product::class])}}"
class="btn btn-outline-dark translat-btn">
<i class="ri-translate"></i>
</a>
@endif
@else
<a href="{{route('admin.product.restore',$n->slug)}}"
class="btn btn-success">
@ -105,5 +107,8 @@
<div class="text-center pt-3">
{{$products->links()}}
</div>
<a class="btn-add" href="{{route('admin.post.create')}}">
<i class="ri-add-line"></i>
</a>
</div>
@endsection

@ -2,10 +2,8 @@
@section('content')
<div class="container">
<h5 class="text-center"> {{__("Properties list")}}
<a class="btn btn-primary float-start" href="{{route('admin.props.create')}}">
<i class="fa fa-plus"></i>
</a>
<h5 class="text-center">
{{__("Properties list")}}
</h5>
<div class="table-responsive">
@ -33,7 +31,7 @@
<td>
{{$p->type}}
</td>
<td>
<td class="no-dec">
@if(isset($p->category))
@foreach($p->category as $c)
<a href="{{route('admin.props.sort',$c->id)}}">
@ -49,14 +47,20 @@
<a title="Edit"
class="btn btn-secondary ad-accept-btn"
href="{{route('admin.props.edit',$p->id)}}">
<i class="fa fa-edit"></i>
<i class="ri-edit-2-line"></i>
</a>
&nbsp;
<a title="Dlete"
class="btn btn-danger cdelete"
href="{{route('admin.props.delete',$p->id)}}">
<i class="fa fa-times"></i>
<i class="ri-close-line"></i>
</a>
@if(config('app.xlang'))
<a href="{{route('admin.lang.model',[$p->id,\App\Models\Prop::class])}}"
class="btn btn-outline-dark translat-btn mx-1">
<i class="ri-translate"></i>
</a>
@endif
</div>
</td>
</tr>
@ -68,4 +72,9 @@
</div>
</div>
</div>
<a class="btn-add" href="{{route('admin.props.create')}}">
<i class="ri-add-line"></i>
</a>
@endsection

@ -22,6 +22,12 @@
</label>
@switch($set->type)
@case('longtext')
@if(config('app.xlang'))
<a href="{{route('admin.lang.model',[$set->id,\App\Models\Setting::class])}}"
class="btn btn-outline-dark translat-btn">
<i class="ri-translate"></i>
</a>
@endif
<textarea name="{{$set->key}}" id="{{$set->key}}" class="form-control"
rows="5">{{$set->value}}</textarea>
@break
@ -51,6 +57,12 @@
rows="5">{{$set->value}}</textarea>
@break
@case('editor')
@if(config('app.xlang'))
<a href="{{route('admin.lang.model',[$set->id,\App\Models\Setting::class])}}"
class="btn btn-outline-dark translat-btn">
<i class="ri-translate"></i>
</a>
@endif
<textarea name="{{$set->key}}" id="{{$set->key}}"
class="ckeditorx form-control"
rows="5">{{$set->value}}</textarea>
@ -79,6 +91,12 @@
class="form-control-file"/>
@break
@default
@if(config('app.xlang'))
<a href="{{route('admin.lang.model',[$set->id,\App\Models\Setting::class])}}"
class="btn btn-outline-dark translat-btn float-end">
<i class="ri-translate"></i>
</a>
@endif
<input type="{{$set->type}}" name="{{$set->key}}" id="{{$set->key}}"
class="form-control" value="{{$set->value}}"/>
@endswitch

@ -20,5 +20,22 @@
window.translate.errMobile = `{{ __('Incorrect mobile number') }}`;
window.translate.discountCodeError= `{{ __('Discount code incorrect') }}`;
window.translate.discountCodeAccept= `{{ __('Discount code accepted') }}`;
@if(request()->route('lang') != null)
// Get all anchor elements on the page
let links = document.getElementsByTagName('a');
const webBase = window.location.protocol + '//' + window.location.host;
// Loop through each anchor element
for (let i = 0; i < links.length; i++) {
let link = links[i];
// Check if the href attribute starts with webBase
if (link.href.indexOf(webBase) === 0) {
// Prefix '/en' to the href attribute
link.href = '/{{request()->route('lang')}}' + link.href.substring(webBase.length);
}
}
@endif
</script>
<link href="{{ asset('css/app.css') }}" rel="stylesheet">

@ -3,10 +3,21 @@
@foreach($items as $item)
<url>
<loc>{{route('cat',$item->slug)}}</loc>
<loc>{{route('product-category.show',$item->slug)}}</loc>
<lastmod>{{ $item->updated_at->tz('UTC')->toAtomString() }}</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
@endforeach
@if(config('app.xlang'))
@foreach(\App\Models\Xlang::where('is_default', 0)->get() as $lang)
<url>
<loc>{{route('lang.product-category.show',[$lang->tag,$item->slug])}}</loc>
<lastmod>{{ $item->updated_at->tz('UTC')->toAtomString() }}</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
@endforeach
@endif
@endsection

@ -7,12 +7,21 @@
<priority>1</priority>
</url>
@foreach($items as $item)
<url>
<loc>{{route('n.show',$item->slug)}}</loc>
<loc>{{route('post.show',$item->slug)}}</loc>
<lastmod>{{ $item->updated_at->tz('UTC')->toAtomString() }}</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
@endforeach
@if(config('app.xlang'))
@foreach(\App\Models\Xlang::where('is_default', 0)->get() as $lang)
<url>
<loc>{{route('lang.post.show',[$lang->tag,$item->slug])}}</loc>
<lastmod>{{ $item->updated_at->tz('UTC')->toAtomString() }}</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
@endforeach
@endif
@endsection

@ -15,4 +15,14 @@
<priority>0.8</priority>
</url>
@endforeach
@if(config('app.xlang'))
@foreach(\App\Models\Xlang::where('is_default', 0)->get() as $lang)
<url>
<loc>{{route('lang.product',[$lang->tag,$item->slug])}}</loc>
<lastmod>{{ $item->updated_at->tz('UTC')->toAtomString() }}</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
@endforeach
@endif
@endsection

@ -23,8 +23,6 @@
</th>
<th>
{{__("Action")}}
<a href="{{route('admin.category.create')}}" class="btn btn-success float-start"><i
class="fa fa-plus"></i></a>
</th>
</tr>
</thead>
@ -43,14 +41,18 @@
</td>
<td>
<a href="{{route('admin.category.edit',$cat->slug)}}" class="btn btn-primary">
<i class="fa fa-edit"></i> &nbsp;
{{__("Edit")}}
<i class="ri-edit-2-line"></i>
</a>
<a href="{{route('admin.category.delete',$cat->slug)}}"
class="btn btn-danger delete-confirm">
<i class="fa fa-times"></i> &nbsp;
{{__("Delete")}}
<i class="ri-close-line"></i>
</a>
@if(config('app.xlang'))
<a href="{{route('admin.lang.model',[$cat->id,\Xmen\StarterKit\Models\Category::class])}}"
class="btn btn-outline-dark translat-btn">
<i class="ri-translate"></i>
</a>
@endif
</td>
</tr>
@endforeach
@ -62,4 +64,8 @@
{{$cats->links()}}
</div>
</div>
<a class="btn-add" href="{{route('admin.category.create')}}">
<i class="ri-add-line"></i>
</a>
@endsection

@ -46,8 +46,6 @@
</th>
<th>
{{__("Action")}}
<a href="{{route('admin.clip.create')}}" class="btn btn-success float-start"><i
class="fa fa-plus"></i></a>
</th>
</tr>
</thead>
@ -69,11 +67,17 @@
</td>
<td>
<a href="{{route('admin.clip.edit',$pl->slug)}}" class="btn btn-secondary">
{{__("Edit")}}
<i class="ri-edit-2-line"></i>
</a>
<a href="{{route('admin.clip.delete',$pl->slug)}}" class="btn btn-danger del-conf">
{{__("Delete")}}
<i class="ri-close-line"></i>
</a>
@if(config('app.xlang'))
<a href="{{route('admin.lang.model',[$n->id,\Xmen\StarterKit\Models\Clip::class])}}"
class="btn btn-outline-dark translat-btn">
<i class="ri-translate"></i>
</a>
@endif
</td>
</tr>
@endforeach
@ -83,5 +87,9 @@
</form>
<br>
{{$clips->links()}}
<a class="btn-add" href="{{route('admin.clip.create')}}">
<i class="ri-add-line"></i>
</a>
</div>
@endsection

@ -97,17 +97,30 @@
<div class="card-body">
<form action="{{route('admin.gallery.updatetitle',$gallery->slug)}}" method="post">
@csrf
<div class="row">
@foreach($gallery->images as $img)
<div class="img-preview">
<div class="col-md-3">
<a href="{{route('admin.image.delete',$img->id)}}" class="del-conf">
<i class="fa fa-times"></i>
</a>
<img src="{{$img->imgUrl()}}" alt="">
<h4>
<input type="text" class="form-control" name="titles[{{$img->id}}]" value="{{$img->title}}"/>
</h4>
<img src="{{$img->imgUrl()}}" class="img-squire" alt="">
<div class="row">
<div class="col-md-9">
<input type="text" class="form-control" name="titles[{{$img->id}}]" value="{{$img->title}}"/>
</div>
<div class="col-md-3">
@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>
<input type="submit" class="btn btn-primary" value="{{__("Save")}}"/>
</form>

@ -40,8 +40,6 @@
</th>
<th>
{{__("Action")}}
<a href="{{route('admin.gallery.create')}}" class="btn btn-success float-start"><i
class="fa fa-plus"></i></a>
</th>
</tr>
</thead>
@ -65,14 +63,18 @@
</td>
<td>
<a href="{{route('admin.gallery.edit',$n->slug)}}" class="btn btn-primary">
<i class="fa fa-edit"></i> &nbsp;
{{__("Edit")}}
<i class="ri-edit-2-line"></i>
</a>
<a href="{{route('admin.gallery.delete',$n->slug)}}"
class="btn btn-danger delete-confirm">
<i class="fa fa-times"></i> &nbsp;
{{__("Delete")}}
<i class="ri-close-line"></i>
</a>
@if(config('app.xlang'))
<a href="{{route('admin.lang.model',[$n->id,\Xmen\StarterKit\Models\Gallery::class])}}"
class="btn btn-outline-dark translat-btn">
<i class="ri-translate"></i>
</a>
@endif
</td>
</tr>
@endforeach
@ -83,5 +85,8 @@
<div class="text-center pt-3">
{{$galleries->links()}}
</div>
<a class="btn-add" href="{{route('admin.gallery.create')}}">
<i class="ri-add-line"></i>
</a>
</div>
@endsection

@ -130,7 +130,7 @@
>
@csrf
<ol class="menu-manage menu-x" id="menu-manage">
{!!\Xmen\StarterKit\Helpers\showMenuMange($menu->menuItems()->whereNull('parent')->orderBy('sort')->get())!!}
{!!\App\Helpers\showMenuMange2($menu->menuItems()->whereNull('parent')->orderBy('sort')->get())!!}
</ol>
<input type="hidden" name="info" value="[]" id="sorted"/>
<input type="button" id="save-menu" class="btn btn-primary" value="{{__("Save")}}">

@ -40,8 +40,6 @@
</th>
<th>
{{__("Action")}}
<a href="{{route('admin.post.create')}}" class="btn btn-success float-start"><i
class="fa fa-plus"></i></a>
</th>
</tr>
</thead>
@ -65,14 +63,18 @@
</td>
<td>
<a href="{{route('admin.post.edit',$n->slug)}}" class="btn btn-primary">
<i class="fa fa-edit"></i> &nbsp;
{{__("Edit")}}
<i class="ri-edit-2-line"></i>
</a>
<a href="{{route('admin.post.delete',$n->slug)}}"
class="btn btn-danger delete-confirm">
<i class="fa fa-times"></i> &nbsp;
{{__("Delete")}}
<i class="ri-close-line"></i>
</a>
@if(config('app.xlang'))
<a href="{{route('admin.lang.model',[$n->id,\Xmen\StarterKit\Models\Post::class])}}"
class="btn btn-outline-dark translat-btn">
<i class="ri-translate"></i>
</a>
@endif
</td>
</tr>
@endforeach
@ -83,5 +85,8 @@
<div class="text-center pt-3">
{{$posts->links()}}
</div>
<a class="btn-add" href="{{route('admin.post.create')}}">
<i class="ri-add-line"></i>
</a>
</div>
@endsection

@ -8,9 +8,6 @@
<div class="container">
<h1>
{{__("Slider list")}}
<a href="{{route('admin.slider.create')}}" class="btn btn-success float-start">
{{__("New Slider")}}
</a>
</h1>
@include('starter-kit::component.err')
<div class="alert alert-dark">
@ -44,8 +41,6 @@
</th>
<th>
{{__("Action")}}
<a href="{{route('admin.slider.create')}}" class="btn btn-success float-start"><i
class="fa fa-plus"></i></a>
</th>
</tr>
</thead>
@ -64,11 +59,17 @@
</td>
<td>
<a href="{{route('admin.slider.edit',$pl->id)}}" class="btn btn-secondary">
{{__("Edit")}}
<i class="ri-edit-2-line"></i>
</a>
<a href="{{route('admin.slider.delete',$pl->id)}}" class="btn btn-danger del-conf">
{{__("Delete")}}
<i class="ri-close-line"></i>
</a>
@if(config('app.xlang'))
<a href="{{route('admin.lang.model',[$pl->id,\Xmen\StarterKit\Models\Slider::class])}}"
class="btn btn-outline-dark translat-btn">
<i class="ri-translate"></i>
</a>
@endif
</td>
</tr>
@endforeach
@ -78,5 +79,8 @@
</form>
<br>
{{$sliders->links()}}
<a class="btn-add" href="{{route('admin.cat.create')}}">
<i class="ri-add-line"></i>
</a>
</div>
@endsection

@ -7,7 +7,7 @@
</div>
<div class="col-md-9">
<h3>
<a href="{{route('n.show',$n->slug)}}">
<a href="{{route('post.show',$n->slug)}}">
{{$n->title}}
</a>
</h3>

@ -1,6 +1,6 @@
@foreach(\App\Adv::where('active',1)->get() as $ad)
<div class="mb-2">
<a href="{{route('n.goadv',$ad->id)}}" class="adv">
<a href="{{route('goadv',$ad->id)}}" class="adv">
<img src="{{$ad->imgUrl()}}" alt="[{{$ad->title}}]" title="{{$ad->title}}">
</a>
</div>

@ -9,7 +9,7 @@
<ul>
@foreach(\App\Helpers\getSettingCategory('footer1')->posts as $p)
<li>
<a href="{{route('n.show',$p->slug)}}">
<a href="{{route('post.show',$p->slug)}}">
{{$p->title}}
</a>
</li>
@ -23,7 +23,7 @@
<ul>
@foreach(\App\Helpers\getSettingCategory('footer2')->posts as $p)
<li>
<a href="{{route('n.show',$p->slug)}}">
<a href="{{route('post.show',$p->slug)}}">
{{$p->title}}
</a>
</li>
@ -82,6 +82,7 @@
{{\App\Helpers\getSetting('copyright')}}
&copy; {{date('Y')}}
</div>
{{\App\Helpers\xroute('contact')}}
</div>
</div>
</div>

@ -106,7 +106,7 @@
</div>
<div class="col-lg-4 col-md-6">
<div class="input-group flex-nowrap" style="margin-top: 1em;">
<input type="text" id="searching" data-url="{{route('search')}}"
<input type="text" id="searching" data-url="{{route('search','')}}"
data-ajax="{{route('search.ajax')}}" class="form-control" placeholder="جستجو در محصولات..."
aria-label="search"
aria-describedby="addon-wrapping">

@ -2,7 +2,7 @@
<ul id="mega-menu">
@foreach(\App\Helpers\getMainCats(8) as $mcat)
<li>
<a href="{{route('cat',$mcat->slug)}}">
<a href="{{route('product-category.show',$mcat->slug)}}">
{{$mcat->name}}
</a>
<ul>
@ -30,7 +30,7 @@
<ul>
@foreach(\App\Helpers\getSubCats($mcat->id) as $subcat)
<li>
<a href="{{route('cat',$subcat->slug)}}">
<a href="{{route('product-category.show',$subcat->slug)}}">
{{$subcat->name}}
</a>
</li>

@ -2,21 +2,21 @@
<ul id="mega-menu">
@foreach(\App\Helpers\getMainCats(8) as $mcat)
<li>
<a href="{{route('cat',$mcat->slug)}}">
<a href="{{route('product-category.show',$mcat->slug)}}">
{{$mcat->name}}
</a>
<ul>
@foreach(\App\Helpers\getSubCats($mcat->id,4) as $subcat)
<li>
<h3>
<a href="{{route('cat',$subcat->slug)}}">
<a href="{{route('product-category.show',$subcat->slug)}}">
{{$subcat->name}}
</a>
</h3>
<ul>
@foreach(\App\Helpers\getSubCats($subcat->id) as $sc)
<li>
<a href="{{route('cat',$sc->slug)}}">
<a href="{{route('product-category.show',$sc->slug)}}">
{{$sc->name}}
</a>
</li>

@ -82,7 +82,7 @@
</label>
<textarea name="bodya" style=" height: 150px;"
class="form-control @error('bodya') is-invalid @enderror"
placeholder="{{__('Question|Message')}}">{{old('body',$item->body??null)}}</textarea>
placeholder="{{__('Question/Message')}}">{{old('body',$item->body??null)}}</textarea>
</div>
</div>
<div class="col-md-10">

@ -166,14 +166,14 @@
<div class="row">
@foreach(\Xmen\StarterKit\Models\Post::where('status',1)->limit(4)->get() as $p)
<div class="col-md-3">
<a href="{{route('n.show',$p->slug)}}" class="text-dark text-decoration-none">
<a href="{{route('post.show',$p->slug)}}" class="text-dark text-decoration-none">
<div class="mb-4 card post-card">
<img src="{{$p->imgurl()}}" class="img-fluid" alt="{{$p->title}}" title="{{$p->title}}">
<div class="card-body">
<h3 class="textt">{{$p->title}}</h3>
<div class="mb-2">
@foreach($p->tags as $tag)
<a class="post-tag ms-2" href="{{route('n.tag',$tag->slug)}}">
<a class="post-tag ms-2" href="{{route('tag.show',$tag->slug)}}">
{{$tag->name}}
</a>
@endforeach
@ -210,7 +210,7 @@
<div class="row">
@foreach(\App\Helpers\getSubCats(\App\Helpers\getSetting('4cat')) as $cat)
<div class="col-md-2 col-sm-3 col-4">
<a href="{{route('cat',$cat->slug)}}">
<a href="{{route('product-category.show',$cat->slug)}}">
<img src="{{$cat->thumbUrl()}}" title="{{$cat->name}}" alt="{{$cat->name}}">
</a>
</div>

@ -15,12 +15,12 @@
</a>
</li>
<li class="breadcrumb-item">
<a href="{{route('n.mag')}}">
<a href="{{route('mag')}}">
{{__("Magazine")}}
</a>
</li>
<li class="breadcrumb-item">
<a href="{{route('n.category',$post->categories()->first()->slug)}}">
<a href="{{route('category.show',$post->categories()->first()->slug)}}">
{{$post->categories()->first()->name}}
</a>
</li>
@ -61,7 +61,7 @@
ارسال دیدگاه
</h5>
<form class="xsumbmiter non-print" method="post" id="comment-form-body" action="no-action">
<input type="hidden" id="smt" value="{{route('n.comment.post',$post->slug)}}">
<input type="hidden" id="smt" value="{{route('comment.post',$post->slug)}}">
@csrf
<input type="hidden" id="reply" name="parent" value="">
<div class="row mb-3">

@ -14,14 +14,14 @@
<div class="row">
@foreach($posts as $p)
<div class="col-md-4">
<a href="{{route('n.show',$p->slug)}}" class="text-dark text-decoration-none">
<a href="{{route('post.show',$p->slug)}}" class="text-dark text-decoration-none">
<div class="mb-4 card post-card">
<img src="{{$p->imgurl()}}" class="img-fluid" alt="{{$p->title}}" title="{{$p->title}}">
<div class="card-body">
<h3 class="textt">{{$p->title}}</h3>
<div class="mb-2">
@foreach($p->tags as $tag)
<a class="post-tag ms-2" href="{{route('n.tag',$tag->slug)}}">
<a class="post-tag ms-2" href="{{route('tag.show',$tag->slug)}}">
{{$tag->name}}
</a>
@endforeach
@ -53,7 +53,7 @@
<ul class="list-group">
@foreach(\Xmen\StarterKit\Models\Post::latest()->limit(10)->get() as $post)
<li class="list-group-item">
<a href="">
<a href="{{route('post.show',$post->slug)}}">
{{$post->title}}
</a>
</li>

@ -63,11 +63,11 @@
</li>
@if ($cat->parent != null)
<li class="breadcrumb-item">
<a href="{{route('cat',$cat->parent->slug)}}">{{$cat->parent->name}}</a>
<a href="{{route('product-category.show',$cat->parent->slug)}}">{{$cat->parent->name}}</a>
</li>
@endif
<li class="breadcrumb-item">
<a href="{{route('cat',$cat->slug)}}">{{$cat->name}}</a>
<a href="{{route('product-category.show',$cat->slug)}}">{{$cat->name}}</a>
</li>
<li class="breadcrumb-item active" aria-current="page">
{{$pro->name}}
@ -279,7 +279,7 @@
<form class="xsumbmiter non-print" method="post" id="comment-form-body"
action="no-action">
<input type="hidden" id="smt"
value="{{route('n.comment.product',$pro->slug)}}">
value="{{route('comment.product',$pro->slug)}}">
@csrf
<input type="hidden" id="reply" name="parent" value="">
<div class="row mb-3">

@ -23,26 +23,29 @@ Route::prefix(config('starter-kit.uri'))->name('admin.')->group(
Route::prefix('users')->name('user.')->group(
function () {
Route::get('/', [\App\Http\Controllers\Admin\UserController::class,'index'])->name('all');
Route::get('/delete/{user}', [\App\Http\Controllers\Admin\UserController::class,'destroy'])->name('delete');
Route::get('/create', [\App\Http\Controllers\Admin\UserController::class,'create'])->name('create');
Route::post('/store', [\App\Http\Controllers\Admin\UserController::class,'store'])->name('store');
Route::get('/edit/{user}', [\App\Http\Controllers\Admin\UserController::class,'edit'])->name('edit');
Route::post('/update/{user}', [\App\Http\Controllers\Admin\UserController::class,'update'])->name('update');
Route::get('/', [\App\Http\Controllers\Admin\UserController::class, 'index'])->name('all');
Route::get('/delete/{user}', [\App\Http\Controllers\Admin\UserController::class, 'destroy'])->name('delete');
Route::get('/create', [\App\Http\Controllers\Admin\UserController::class, 'create'])->name('create');
Route::post('/store', [\App\Http\Controllers\Admin\UserController::class, 'store'])->name('store');
Route::get('/edit/{user}', [\App\Http\Controllers\Admin\UserController::class, 'edit'])->name('edit');
Route::post('/update/{user}', [\App\Http\Controllers\Admin\UserController::class, 'update'])->name('update');
});
Route::prefix('langs')->name('lang.')->group(
function () {
Route::get('/', [\App\Http\Controllers\Admin\XlangController::class,'index'])->name('index');
Route::get('/translates', [\App\Http\Controllers\Admin\XlangController::class,'translate'])->name('translate');
Route::get('/delete/{xlang}', [\App\Http\Controllers\Admin\XlangController::class,'destroy'])->name('delete');
Route::get('/create', [\App\Http\Controllers\Admin\XlangController::class,'create'])->name('create');
Route::post('/store', [\App\Http\Controllers\Admin\XlangController::class,'store'])->name('store');
Route::get('/edit/{xlang}', [\App\Http\Controllers\Admin\XlangController::class,'edit'])->name('edit');
Route::post('/update/{xlang}', [\App\Http\Controllers\Admin\XlangController::class,'update'])->name('update');
Route::get('/', [\App\Http\Controllers\Admin\XlangController::class, 'index'])->name('index');
Route::get('/translates', [\App\Http\Controllers\Admin\XlangController::class, 'translate'])->name('translate');
Route::get('/delete/{xlang}', [\App\Http\Controllers\Admin\XlangController::class, 'destroy'])->name('delete');
Route::get('/create', [\App\Http\Controllers\Admin\XlangController::class, 'create'])->name('create');
Route::post('/store', [\App\Http\Controllers\Admin\XlangController::class, 'store'])->name('store');
Route::get('/edit/{xlang}', [\App\Http\Controllers\Admin\XlangController::class, 'edit'])->name('edit');
Route::post('/update/{xlang}', [\App\Http\Controllers\Admin\XlangController::class, 'update'])->name('update');
Route::post('bulk', [\App\Http\Controllers\Admin\XlangController::class, "bulk"])->name('bulk');
Route::get('/download/{tag}', [\App\Http\Controllers\Admin\XlangController::class,'download'])->name('download');
Route::get('/ai/{tag}', [\App\Http\Controllers\Admin\XlangController::class,'ai'])->name('ai');
Route::post('/upload/{tag}', [\App\Http\Controllers\Admin\XlangController::class,'upload'])->name('upload');
Route::get('/download/{tag}', [\App\Http\Controllers\Admin\XlangController::class, 'download'])->name('download');
Route::get('/ai/{tag}', [\App\Http\Controllers\Admin\XlangController::class, 'ai'])->name('ai');
Route::post('/upload/{tag}', [\App\Http\Controllers\Admin\XlangController::class, 'upload'])->name('upload');
Route::get('/model/translate/{id}/{model}', [\App\Http\Controllers\Admin\XlangController::class, 'translateModel'])->name('model');
Route::post('/model/translate/save/{id}/{model}', [\App\Http\Controllers\Admin\XlangController::class, 'translateModelSave'])->name('modelSave');
Route::get('/model/ai/{id}/{model}/{field}/{lang}', [\App\Http\Controllers\Admin\XlangController::class, 'translateModelAi'])->name('aiText');
});
@ -186,6 +189,13 @@ Route::prefix(config('starter-kit.uri'))->name('admin.')->group(
}
);
});
// site map
Route::get('/sitemap.xml', [App\Http\Controllers\SitemapController::class, 'index'])->name('sitemap.index');
Route::get('/sitemap/posts.xml', [App\Http\Controllers\SitemapController::class, 'posts'])->name('sitemap.posts');
Route::get('/sitemap/cats.xml', [App\Http\Controllers\SitemapController::class, 'cats'])->name('sitemap.cats');
Route::get('/sitemap/products.xml', [App\Http\Controllers\SitemapController::class, 'products'])->name('sitemap.products');
Route::get('/props/list/{id}', [\App\Http\Controllers\Admin\PropController::class, 'list'])->name('props.list');
// for under construction
@ -194,26 +204,10 @@ Route::get('/props/list/{id}', [\App\Http\Controllers\Admin\PropController::clas
Route::group(
['middleware' => ['under']],
function () {
Route::get('/', [App\Http\Controllers\WebsiteController::class, 'index'])->name('welcome');
Route::get('/product-category/{cat}', [App\Http\Controllers\WebsiteController::class, 'cat'])->name('cat');
Route::get('/product/{pro}', [App\Http\Controllers\WebsiteController::class, 'product'])->name('product');
Route::get('/compare/remove/{pro}', [App\Http\Controllers\WebsiteController::class, 'compareRem'])->name('compare.rem');
Route::get('/compare/add/{pro}', [App\Http\Controllers\WebsiteController::class, 'compareAdd'])->name('compare.add');
Route::get('/compare', [App\Http\Controllers\WebsiteController::class, 'compare'])->name('compare');
Route::get('/card-add/{id}', [App\Http\Controllers\WebsiteController::class, 'cardAdd'])->name('card.add');
Route::get('/card-rem/{id}', [App\Http\Controllers\WebsiteController::class, 'cardRem'])->name('card.rem');
Route::get('/card-add-q/{id}/{count}', [App\Http\Controllers\WebsiteController::class, 'cardAddQ'])->name('card.addq');
Route::get('/card-rem-q/{id}', [App\Http\Controllers\WebsiteController::class, 'cardRemQ'])->name('card.remq');
Route::get('/post/{post}', [App\Http\Controllers\WebsiteController::class, 'post'])->name('post');
Route::get('/products', [App\Http\Controllers\WebsiteController::class, 'products'])->name('products');
Route::get('/search/ajax', [App\Http\Controllers\WebsiteController::class, 'searchAjax'])->name('search.ajax');
Route::get('/search', [App\Http\Controllers\WebsiteController::class, 'search'])->name('search');
Route::get('/card', [App\Http\Controllers\WebsiteController::class, 'card'])->name('card.show');
Route::get('/sign', [App\Http\Controllers\WebsiteController::class, 'sign'])->name('sign');
Route::get('/customer/invoice/{invoice}', [App\Http\Controllers\CustomerController::class, 'invoice'])->name('customer.invoice')->middleware('auth:customer');
Route::get('/customer/address/save', [App\Http\Controllers\CustomerController::class, 'saveAddress'])->name('customer.address')->middleware('auth:customer');
Route::get('/customer/address/rem/{address}', [App\Http\Controllers\CustomerController::class, 'remAddress'])->name('customer.remaddress')->middleware('auth:customer');
Route::get('/customer', [App\Http\Controllers\CustomerController::class, 'index'])->name('customer')->middleware('auth:customer');
Route::post('/signin', [\App\Http\Controllers\Auth\LoginController::class, 'customerLogin'])->name('signin');
Route::post('/signup', [\App\Http\Controllers\Auth\RegisterController::class, 'createCustomer'])->name('signup');
@ -222,44 +216,136 @@ Route::group(
Route::post('/checkSMS', [\App\Http\Controllers\WebsiteController::class, 'checkSMS'])->name('checkSMS');
Route::post('/profile', [\App\Http\Controllers\WebsiteController::class, 'profile'])->name('profile');
Route::get('/logout', [\App\Http\Controllers\WebsiteController::class, 'logout'])->name('logout');
Route::get('/products', [App\Http\Controllers\WebsiteController::class, 'products'])->name('products');
Route::post('/contact/send', [App\Http\Controllers\WebsiteController::class, "sendContact"])->name('sendcontact');
Route::get('/contact', [App\Http\Controllers\WebsiteController::class, "contact"])->name('contact');
Route::get('/reset', [App\Http\Controllers\WebsiteController::class, "reset"])->name('reset');
Route::get('/resetStock', [App\Http\Controllers\WebsiteController::class, "resetStockStatus"])->name('resetStock');
Route::get('/resetQ', [App\Http\Controllers\WebsiteController::class, "resetQuantity"])->name('resetQuantity');
Route::get('/credit/pay/{invoice}', [App\Http\Controllers\CustomerController::class, 'credit'])->name('credit');
Route::post('/invoice', [\App\Http\Controllers\Payment\GatewayRedirectController::class, 'createInvoice'])->middleware('auth:customer')->name('invoice.create');
Route::get('/mag', [App\Http\Controllers\WebsiteController::class, 'mag'])->name('mag');
Route::get('/search/ajax', [App\Http\Controllers\WebsiteController::class, 'searchAjax'])->name('search.ajax');
Route::get('/compare/now', [App\Http\Controllers\WebsiteController::class, 'compare'])->name('compare');
Route::get('/posts', [App\Http\Controllers\WebsiteController::class, 'posts'])->name('posts');
Route::get('/track', [App\Http\Controllers\WebsiteController::class, 'track'])->name('track');
Route::post('/discount', [\App\Http\Controllers\WebsiteController::class, 'discount'])->name('discount');
Route::get('galleries', [App\Http\Controllers\WebsiteController::class, 'galleries'])->name('galleries');
Route::get('clips', [App\Http\Controllers\WebsiteController::class, 'clips'])->name('clips');
Route::get('/customer/address/save', [App\Http\Controllers\CustomerController::class, 'saveAddress'])->name('customer.address')->middleware('auth:customer');
Route::post('/ticket/send', [\App\Http\Controllers\CustomerController::class, 'SendTicket'])->name('ticket.send');
Route::get('/product-category/{cat}', [App\Http\Controllers\WebsiteController::class, 'cat'])->name('cat');
Route::get('/product/{pro}', [App\Http\Controllers\WebsiteController::class, 'product'])->name('product');
Route::get('/compare/remove/{pro}', [App\Http\Controllers\WebsiteController::class, 'compareRem'])->name('compare.rem');
Route::get('/compare/add/{pro}', [App\Http\Controllers\WebsiteController::class, 'compareAdd'])->name('compare.add');
Route::get('/card-add/{id}', [App\Http\Controllers\WebsiteController::class, 'cardAdd'])->name('card.add');
Route::get('/card-rem/{id}', [App\Http\Controllers\WebsiteController::class, 'cardRem'])->name('card.rem');
Route::get('/card-add-q/{id}/{count}', [App\Http\Controllers\WebsiteController::class, 'cardAddQ'])->name('card.addq');
Route::get('/card-rem-q/{id}', [App\Http\Controllers\WebsiteController::class, 'cardRemQ'])->name('card.remq');
Route::get('/post/{post}', [App\Http\Controllers\WebsiteController::class, 'post'])->name('post');
Route::get('/customer/invoice/{invoice}', [App\Http\Controllers\CustomerController::class, 'invoice'])->name('customer.invoice')->middleware('auth:customer');
Route::get('/customer/address/rem/{address}', [App\Http\Controllers\CustomerController::class, 'remAddress'])->name('customer.remaddress')->middleware('auth:customer');
Route::get('/invoice/qr/{hash}', [\App\Http\Controllers\CustomerController::class, 'qr'])->name('invoice.qr');
Route::get('/invoice/pdf/{hash}', [\App\Http\Controllers\CustomerController::class, 'pdf'])->name('invoice.pdf');
Route::post('/ticket/send', [\App\Http\Controllers\CustomerController::class, 'SendTicket'])->name('ticket.send');
Route::get('/ticket/{ticket}', [\App\Http\Controllers\CustomerController::class, 'ticket'])->name('ticket.show');
Route::get('/posts', [App\Http\Controllers\WebsiteController::class, 'posts'])->name('posts');
Route::get('/track', [App\Http\Controllers\WebsiteController::class, 'track'])->name('track');
Route::get('/fav/toggle/{product}', [App\Http\Controllers\WebsiteController::class, 'favToggle'])->name('fav.toggle');
Route::get('/tag/{tag}', [App\Http\Controllers\WebsiteController::class, 'tag'])->name('tag.show');
Route::get('/category/{category}', [App\Http\Controllers\WebsiteController::class, 'category'])->name('category.show');
Route::get('/product-category/{cat}', [App\Http\Controllers\WebsiteController::class, 'cat'])->name('product-category.show');
Route::get('/post/{post}', [App\Http\Controllers\WebsiteController::class, 'post'])->name('post.show');
Route::get('/g/{gallery}', [App\Http\Controllers\WebsiteController::class, 'gallery'])->name('gallery');
Route::get('/s/{term}', [App\Http\Controllers\WebsiteController::class, 'search'])->name('search');
Route::post('/comment/post/{post}', [App\Http\Controllers\WebsiteController::class, 'commentPost'])->name('comment.post');
Route::post('/comment/product/{product}', [App\Http\Controllers\WebsiteController::class, 'commentProduct'])->name('comment.product');
Route::post('/like/{news}', [App\Http\Controllers\WebsiteController::class, 'like'])->name('like');
Route::post('/vote/{poll}', [App\Http\Controllers\WebsiteController::class, 'vote'])->name('vote');
Route::get('/poll/{poll}', [App\Http\Controllers\WebsiteController::class, 'poll'])->name('poll');
Route::get('/goadv/{adv}', [App\Http\Controllers\WebsiteController::class, 'goadv'])->name('goadv');
Route::get('/redirect/bank/{invoice}/{gateway}', \App\Http\Controllers\Payment\GatewayRedirectController::class)->name('redirect.bank');
Route::any('/pay/check/{invoice_hash}/{gateway}', \App\Http\Controllers\Payment\GatewayVerifyController::class)->name('pay.check');
});
Route::get('/underConstruct', function () {
return view('website.under');
});
Route::prefix('')->name('n.')->group(function () {
Route::get('mag', [App\Http\Controllers\WebsiteController::class, 'mag'])->name('mag');
Route::get('tag/{tag}', [App\Http\Controllers\WebsiteController::class, 'tag'])->name('tag');
Route::get('category/{category}', [App\Http\Controllers\WebsiteController::class, 'category'])->name('category');
Route::get('category/{cat}', [App\Http\Controllers\WebsiteController::class, 'cat'])->name('cat');
Route::get('n/{post}', [App\Http\Controllers\WebsiteController::class, 'post'])->name('show');
Route::get('galleries', [App\Http\Controllers\WebsiteController::class, 'galleries'])->name('galleries');
Route::get('clips', [App\Http\Controllers\WebsiteController::class, 'clips'])->name('clips');
// Route::get('faq', "WebsiteController@faq")->name('faq'); //ESH
Route::get('g/{gallery}', [App\Http\Controllers\WebsiteController::class, 'gallery'])->name('gallery');
Route::get('s/{term}', [App\Http\Controllers\WebsiteController::class, 'search'])->name('search');
Route::post('comment/post/{post}', [App\Http\Controllers\WebsiteController::class, 'commentPost'])->name('comment.post');
Route::post('comment/product/{product}', [App\Http\Controllers\WebsiteController::class, 'commentProduct'])->name('comment.product');
Route::post('like/{news}', [App\Http\Controllers\WebsiteController::class, 'like'])->name('like');
Route::post('vote/{poll}', [App\Http\Controllers\WebsiteController::class, 'vote'])->name('vote');
Route::get('poll/{poll}', [App\Http\Controllers\WebsiteController::class, 'poll'])->name('poll');
Route::get('goadv/{adv}', [App\Http\Controllers\WebsiteController::class, 'goadv'])->name('goadv');
// Route::post('assign', [App\Http\Controllers\WebsiteController::class, ''])->name('assign');
//Route::get('contact', [App\Http\Controllers\WebsiteController::class, "contact"])->name('contact');
//Route::get('mag', [App\Http\Controllers\WebsiteController::class, 'mag'])->name('mag');
Route::prefix('/{lang?}')->name('lang.')->group(function () {
Route::group(
['middleware' => ['lang']],
function () {
Route::get('/', [App\Http\Controllers\WebsiteController::class, 'index'])->name('welcome');
Route::get('/search', [App\Http\Controllers\WebsiteController::class, 'search'])->name('search');
Route::get('/card', [App\Http\Controllers\WebsiteController::class, 'card'])->name('card.show');
Route::get('/sign', [App\Http\Controllers\WebsiteController::class, 'sign'])->name('sign');
Route::get('/customer', [App\Http\Controllers\CustomerController::class, 'index'])->name('customer')->middleware('auth:customer');
Route::post('/signin', [\App\Http\Controllers\Auth\LoginController::class, 'customerLogin'])->name('signin');
Route::post('/signup', [\App\Http\Controllers\Auth\RegisterController::class, 'createCustomer'])->name('signup');
Route::post('/question/send', [\App\Http\Controllers\WebsiteController::class, 'questionSend'])->name('question.send');
Route::post('/sendSMS', [\App\Http\Controllers\WebsiteController::class, 'sendSMS'])->name('sendSMS');
Route::post('/checkSMS', [\App\Http\Controllers\WebsiteController::class, 'checkSMS'])->name('checkSMS');
Route::post('/profile', [\App\Http\Controllers\WebsiteController::class, 'profile'])->name('profile');
Route::get('/logout', [\App\Http\Controllers\WebsiteController::class, 'logout'])->name('logout');
Route::get('/products', [App\Http\Controllers\WebsiteController::class, 'products'])->name('products');
Route::post('/contact/send', [App\Http\Controllers\WebsiteController::class, "sendContact"])->name('sendcontact');
Route::get('/contact', [App\Http\Controllers\WebsiteController::class, "contact"])->name('contact');
Route::get('/reset', [App\Http\Controllers\WebsiteController::class, "reset"])->name('reset');
Route::get('/resetStock', [App\Http\Controllers\WebsiteController::class, "resetStockStatus"])->name('resetStock');
Route::get('/resetQ', [App\Http\Controllers\WebsiteController::class, "resetQuantity"])->name('resetQuantity');
Route::get('/credit/pay/{invoice}', [App\Http\Controllers\CustomerController::class, 'credit'])->name('credit');
Route::post('/invoice', [\App\Http\Controllers\Payment\GatewayRedirectController::class, 'createInvoice'])->middleware('auth:customer')->name('invoice.create');
Route::get('/mag', [App\Http\Controllers\WebsiteController::class, 'mag'])->name('mag');
Route::get('/search/ajax', [App\Http\Controllers\WebsiteController::class, 'searchAjax'])->name('search.ajax');
Route::get('/compare/now', [App\Http\Controllers\WebsiteController::class, 'compare'])->name('compare');
Route::get('/posts', [App\Http\Controllers\WebsiteController::class, 'posts'])->name('posts');
Route::get('/track', [App\Http\Controllers\WebsiteController::class, 'track'])->name('track');
Route::post('/discount', [\App\Http\Controllers\WebsiteController::class, 'discount'])->name('discount');
Route::get('galleries', [App\Http\Controllers\WebsiteController::class, 'galleries'])->name('galleries');
Route::get('clips', [App\Http\Controllers\WebsiteController::class, 'clips'])->name('clips');
Route::get('/customer/address/save', [App\Http\Controllers\CustomerController::class, 'saveAddress'])->name('customer.address')->middleware('auth:customer');
Route::post('/ticket/send', [\App\Http\Controllers\CustomerController::class, 'SendTicket'])->name('ticket.send');
Route::get('category/{category}', [App\Http\Controllers\WebsiteController::class, 'categoryLang'])->name('category.show');
Route::get('/product-category/{cat}', [App\Http\Controllers\WebsiteController::class, 'catLang'])->name('product-category.show');
Route::get('/product/{pro}', [App\Http\Controllers\WebsiteController::class, 'productLang'])->name('product');
Route::get('post/{post}', [App\Http\Controllers\WebsiteController::class, 'postLang'])->name('post.show');
Route::get('/compare/remove/{pro}', [App\Http\Controllers\WebsiteController::class, 'compareRemLang'])->name('compare.rem');
Route::get('/compare/add/{pro}', [App\Http\Controllers\WebsiteController::class, 'compareAddLang'])->name('compare.add');
Route::get('/card-add/{id}', [App\Http\Controllers\WebsiteController::class, 'cardAddLang'])->name('card.add');
Route::get('/card-rem/{id}', [App\Http\Controllers\WebsiteController::class, 'cardRemLang'])->name('card.rem');
Route::get('/card-add-q/{id}/{count}', [App\Http\Controllers\WebsiteController::class, 'cardAddQLang'])->name('card.addq');
Route::get('/card-rem-q/{id}', [App\Http\Controllers\WebsiteController::class, 'cardRemQLang'])->name('card.remq');
Route::get('/customer/invoice/{invoice}', [App\Http\Controllers\CustomerController::class, 'invoiceLang'])->name('customer.invoice')->middleware('auth:customer');
Route::get('/customer/address/rem/{address}', [App\Http\Controllers\CustomerController::class, 'remAddressLang'])->name('customer.remaddress')->middleware('auth:customer');
Route::get('/invoice/qr/{hash}', [\App\Http\Controllers\CustomerController::class, 'qrLang'])->name('invoice.qr');
Route::get('/invoice/pdf/{hash}', [\App\Http\Controllers\CustomerController::class, 'pdfLang'])->name('invoice.pdf');
Route::get('/ticket/{ticket}', [\App\Http\Controllers\CustomerController::class, 'ticketLang'])->name('ticket.show');
Route::get('/fav/toggle/{product}', [App\Http\Controllers\WebsiteController::class, 'favToggleLang'])->name('fav.toggle');
Route::get('tag/{tag}', [App\Http\Controllers\WebsiteController::class, 'tagLang'])->name('tag.show');
Route::get('/g/{gallery}', [App\Http\Controllers\WebsiteController::class, 'galleryLang'])->name('gallery');
Route::get('/s/{term}', [App\Http\Controllers\WebsiteController::class, 'searchLang'])->name('search');
Route::post('/comment/post/{post}', [App\Http\Controllers\WebsiteController::class, 'commentPostLang'])->name('comment.post');
Route::post('/comment/product/{product}', [App\Http\Controllers\WebsiteController::class, 'commentProductLang'])->name('comment.product');
Route::post('/like/{news}', [App\Http\Controllers\WebsiteController::class, 'likeLang'])->name('like');
Route::post('/vote/{poll}', [App\Http\Controllers\WebsiteController::class, 'voteLang'])->name('vote');
Route::get('/poll/{poll}', [App\Http\Controllers\WebsiteController::class, 'pollLang'])->name('poll');
Route::get('/goadv/{adv}', [App\Http\Controllers\WebsiteController::class, 'goadvLang'])->name('goadv');
// need check by Sadeghpm
Route::get('/redirect/bank/{invoice}/{gateway}', \App\Http\Controllers\Payment\GatewayRedirectController::class)->name('redirect.bank');
Route::any('/pay/check/{invoice_hash}/{gateway}', \App\Http\Controllers\Payment\GatewayVerifyController::class)->name('pay.check');
});
});
// site map
Route::get('/sitemap.xml', [App\Http\Controllers\SitemapController::class, 'index'])->name('sitemap.index');
Route::get('/sitemap/posts.xml', [App\Http\Controllers\SitemapController::class, 'posts'])->name('sitemap.posts');
Route::get('/sitemap/cats.xml', [App\Http\Controllers\SitemapController::class, 'cats'])->name('sitemap.cats');
Route::get('/sitemap/products.xml', [App\Http\Controllers\SitemapController::class, 'products'])->name('sitemap.products');
//Route::get('impex/customer', [App\Http\Controllers\ImpexController::class, 'customer'])->name('impex.customer');
//Route::get('impex/col', [App\Http\Controllers\ImpexController::class, 'col'])->name('impex.col');
@ -279,32 +365,23 @@ Auth::routes([
'register' => false,
]);
//
Route::post('/invoice', [\App\Http\Controllers\Payment\GatewayRedirectController::class, 'createInvoice'])->middleware('auth:customer')->name('invoice.create');
Route::get('/redirect/bank/{invoice}/{gateway}', \App\Http\Controllers\Payment\GatewayRedirectController::class)->name('redirect.bank');
Route::any('/pay/check/{invoice_hash}/{gateway}', \App\Http\Controllers\Payment\GatewayVerifyController::class)->name('pay.check');
Route::get('/fav/toggle/{product}', [App\Http\Controllers\WebsiteController::class, 'favToggle'])->name('fav.toggle');
Route::post('/contact/send', [App\Http\Controllers\WebsiteController::class, "sendContact"])->name('sendcontact');
Route::get('/contact', [App\Http\Controllers\WebsiteController::class, "contact"])->name('contact');
Route::get('/reset', [App\Http\Controllers\WebsiteController::class, "reset"])->name('reset');
Route::get('/resetStock', [App\Http\Controllers\WebsiteController::class, "resetStockStatus"])->name('resetStock');
Route::get('/resetQ', [App\Http\Controllers\WebsiteController::class, "resetQuantity"])->name('resetQuantity');
Route::get('/credit/pay/{invoice}', [App\Http\Controllers\CustomerController::class, 'credit'])->name('credit');
Route::get('/test/sms',function (){
if (auth()->check()){
$result = \App\Helpers\sendSMSText2('09209517726','پیامک');
if ($result == null){
return 'fatal error';
}else{
if ($result['OK']){
return $result['Msg'];
}else{
return 'err'.$result['Code'].': '.$result['Msg'];
}
}
} else{
return abort(403);
}
Route::get('/test/sms', function () {
if (auth()->check()) {
$result = \App\Helpers\sendSMSText2(\App\Helpers\getSetting('tel'), 'پیامک');
if ($result == null) {
return 'fatal error';
} else {
if ($result['OK']) {
return $result['Msg'];
} else {
return 'err' . $result['Code'] . ': ' . $result['Msg'];
}
}
} else {
return abort(403);
}
});

@ -40,7 +40,7 @@ class websitePagesTest extends TestCase
public function test_single_post()
{
if (Post::count() > 0) {
$response = $this->get(route('post', Post::inRandomOrder()->first()->slug));
$response = $this->get(route('post.show', Post::inRandomOrder()->first()->slug));
$response->assertStatus(200);
} else {
$this->assertTrue(true);
@ -61,7 +61,7 @@ class websitePagesTest extends TestCase
public function test_single_product_category()
{
$response = $this->get(route('cat', Cat::inRandomOrder()->first()->slug));
$response = $this->get(route('product-category.show', Cat::inRandomOrder()->first()->slug));
$response->assertStatus(200);
}

Loading…
Cancel
Save