Skip to content

Commit

Permalink
update laravel to 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
igoves committed Jun 10, 2020
1 parent 8f22a0c commit 8715f99
Show file tree
Hide file tree
Showing 69 changed files with 240 additions and 1,744 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ APP_URL=http://lashop.loc
LOG_CHANNEL=stack

DB_CONNECTION=sqlite
DB_DATABASE=d:/HTDOCS/lashop.loc/database/database.sqlite
DB_DATABASE=c:/OpenServer/domains/lashop.loc/database/database.sqlite

BROADCAST_DRIVER=log
CACHE_DRIVER=file
Expand All @@ -33,3 +33,4 @@ PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## About Lashop

It is simple and fast shop based on laravel 5.6 and work without MySQL, you need only SQLite3.
It is simple and fast shop based on laravel 7.3 and work without MySQL, you need only SQLite3.

PHP, SQLite, Fullajax, Meta, SEO, Friendly URL, Minimize html, twitter bootstrap 4, AdminLTE, backup, media-manager.

Expand Down Expand Up @@ -63,7 +63,7 @@ The Lashop is open-sourced software licensed under the [MIT license](http://open
Hello, my name is Igor Veselov. I am Senior Full Stack Web Developer. Main specialization - Ecommerce websites. On this time developed CMS [vvShop](https://vvshop.xfor.top) and other e-commerce projects turnkey. Opened for interesting offers.

## Contacts
- SKYPE: [utz0r2](skype:utz0r2)
- TELEGRAM: [igoves](https://t.me/igoves)
- EMAIL: [dev@xfor.top](mailto:dev@xfor.top)
- WWW: https://xfor.top
- LinkedIn: https://www.linkedin.com/in/igor-veselov/
Expand Down
2 changes: 1 addition & 1 deletion app/Admin/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function index()
// $stats['pages'] = DB::table('pages')->count();
$stats['orders'] = DB::table('shop_orders')->count();
$stats['revenue'] = DB::table('shop_orders')->sum('total');
$column->append( view('admin.dashboard', ['orders' => $stats['orders'], 'revenue' => $stats['revenue'], 'products' => $stats['products'], 'categories' => $stats['categories']]) );
$column->append(view('admin.dashboard', ['orders' => $stats['orders'], 'revenue' => $stats['revenue'], 'products' => $stats['products'], 'categories' => $stats['categories']]));
});

$row->column(4, function (Column $column) {
Expand Down
6 changes: 4 additions & 2 deletions app/Admin/Controllers/PageController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace App\Admin\Controllers;

use Encore\Admin\Form;
Expand Down Expand Up @@ -51,7 +52,7 @@ protected function grid()
$grid->created_at();
$grid->updated_at();
$grid->actions(function ($actions) {
$actions->prepend('<a href="/'.$actions->row->slug.'.html" target="_blank"><i class="fa fa-eye"></i></a>');
$actions->prepend('<a href="/' . $actions->row->slug . '.html" target="_blank"><i class="fa fa-eye"></i></a>');
});
});
}
Expand All @@ -74,6 +75,7 @@ public function edit($id)
$content->body($this->form()->edit($id));
});
}

/**
* Create interface.
*
Expand Down Expand Up @@ -109,4 +111,4 @@ protected function form()
});
}

}
}
14 changes: 11 additions & 3 deletions app/Admin/Controllers/Shop/CategoryController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace App\Admin\Controllers\Shop;

use App\Http\Controllers\Controller;
use App\Models\Shop\Category;
use Encore\Admin\Form;
Expand All @@ -8,9 +10,11 @@
use Encore\Admin\Layout\Content;
use Encore\Admin\Controllers\ModelForm;
use Encore\Admin\Tree;

class CategoryController extends Controller
{
use ModelForm;

/**
* Index interface.
*
Expand All @@ -27,6 +31,7 @@ public function index()
$content->body($this->tree());
});
}

/**
* Edit interface.
*
Expand All @@ -45,6 +50,7 @@ public function edit($id)
$content->body($this->form()->edit($id));
});
}

/**
* Create interface.
*
Expand All @@ -62,6 +68,7 @@ public function create()
$content->body($this->form());
});
}

/**
* Make a grid builder.
*
Expand All @@ -71,15 +78,16 @@ protected function tree()
{
return Category::tree(function (Tree $tree) {
$tree->branch(function ($branch) {
$src = config('admin.upload.host') . '/uploads/' . $branch['logo'] ;
$src = config('admin.upload.host') . '/uploads/' . $branch['logo'];
$logo = '';
if ( trim($branch['logo']) !== '' ) {
if (trim($branch['logo']) !== '') {
$logo = "<img src='$src' style='max-width:30px;max-height:30px' class='img'/>";
}
return "{$branch['id']} - {$branch['title']} - {$branch['slug']} $logo";
});
});
}

/**
* Make a form builder.
*
Expand All @@ -100,4 +108,4 @@ protected function form()
$form->display('updated_at', 'Updated At');
});
}
}
}
5 changes: 5 additions & 0 deletions app/Admin/Controllers/Shop/OrderController.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php

namespace App\Admin\Controllers\Shop;

use App\Http\Controllers\Controller;

//use App\Models\Shop\Category;
//use App\Models\Shop\Product;
use App\Models\Shop\Order;
Expand All @@ -10,11 +12,13 @@
use Encore\Admin\Facades\Admin;
use Encore\Admin\Layout\Content;
use Encore\Admin\Controllers\ModelForm;

//use Encore\Admin\Tree;

class OrderController extends Controller
{
use ModelForm;

/**
* Index interface.
*
Expand Down Expand Up @@ -75,6 +79,7 @@ public function edit($id)
$content->body($this->form()->edit($id));
});
}

/**
* Create interface.
*
Expand Down
11 changes: 8 additions & 3 deletions app/Admin/Controllers/Shop/ProductController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace App\Admin\Controllers\Shop;

use App\Http\Controllers\Controller;
use App\Models\Shop\Category;
use App\Models\Shop\Product;
Expand All @@ -9,9 +11,11 @@
use Encore\Admin\Layout\Content;
use Encore\Admin\Controllers\ModelForm;
use Encore\Admin\Tree;

class ProductController extends Controller
{
use ModelForm;

/**
* Index interface.
*
Expand Down Expand Up @@ -51,7 +55,7 @@ protected function grid()
$grid->created_at();
$grid->updated_at();
$grid->actions(function ($actions) {
$actions->prepend('<a href="/'.$actions->row->id.'-'.$actions->row->slug.'" target="_blank"><i class="fa fa-eye"></i></a>');
$actions->prepend('<a href="/' . $actions->row->id . '-' . $actions->row->slug . '" target="_blank"><i class="fa fa-eye"></i></a>');
});
});
}
Expand All @@ -74,6 +78,7 @@ public function edit($id)
$content->body($this->form()->edit($id));
});
}

/**
* Create interface.
*
Expand Down Expand Up @@ -103,7 +108,7 @@ protected function form()
$form->display('id', 'ID');
$form->text('title')->rules('required');
$form->text('slug')->rules('required');
$form->select('cat_id', 'Category')->options(Category::all()->pluck('title','id'));
$form->select('cat_id', 'Category')->options(Category::all()->pluck('title', 'id'));
$form->image('photo');
$form->wangeditor('fulldesc', 'Description');
$form->text('cost');
Expand All @@ -114,4 +119,4 @@ protected function form()
$form->display('updated_at', 'Updated At');
});
}
}
}
5 changes: 4 additions & 1 deletion app/Admin/Extensions/Form/WangEditor.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace App\Admin\Extensions\Form;

use Encore\Admin\Form\Field;

class WangEditor extends Field
Expand All @@ -11,6 +13,7 @@ class WangEditor extends Field
protected static $js = [
'/vendor/wangEditor-3.0.10/release/wangEditor.js',
];

public function render()
{
$name = $this->formatName($this->column);
Expand All @@ -26,4 +29,4 @@ public function render()
EOT;
return parent::render();
}
}
}
3 changes: 2 additions & 1 deletion app/Admin/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

use Encore\Admin\Form;
use App\Admin\Extensions\Form\WangEditor;
use App\Admin\Extensions\Nav\Links;
Expand Down Expand Up @@ -28,4 +29,4 @@
Admin::navbar(function (\Encore\Admin\Widgets\Navbar $navbar) {
// $navbar->left(view('admin.search-bar'));
$navbar->right(view('admin.nav-links'));
});
});
7 changes: 4 additions & 3 deletions app/Admin/routes.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?php

use Illuminate\Routing\Router;


Admin::registerAuthRoutes();

Route::group([
'prefix' => config('admin.route.prefix'),
'namespace' => config('admin.route.namespace'),
'middleware' => config('admin.route.middleware'),
'prefix' => config('admin.route.prefix'),
'namespace' => config('admin.route.namespace'),
'middleware' => config('admin.route.middleware'),
], function (Router $router) {

$router->get('/', 'HomeController@index');
Expand Down
7 changes: 4 additions & 3 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

namespace App\Exceptions;

use Exception;
//use Exception;
Use Throwable;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
Expand Down Expand Up @@ -32,7 +33,7 @@ class Handler extends ExceptionHandler
* @param \Exception $exception
* @return void
*/
public function report(Exception $exception)
public function report(Throwable $exception)
{
parent::report($exception);
}
Expand All @@ -44,7 +45,7 @@ public function report(Exception $exception)
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
public function render($request, Throwable $exception)
{
return parent::render($request, $exception);
}
Expand Down
12 changes: 8 additions & 4 deletions app/Frontend/Controllers/HomeController.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

namespace App\Http\Controllers\Frontend;

use App\Http\Controllers\Controller;
use App\Models\Shop\Product;
use Illuminate\Http\Response;

class HomeController extends Controller
{
Expand All @@ -11,15 +13,17 @@ class HomeController extends Controller
*
* @return void
*/
public function __construct() {}
public function __construct()
{
}

/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
* @return Response
*/
public function index()
{
return view('frontend.'.config('template').'.home', ['products' => Product::where('status', 1)->limit(3)->get(), 'breadcrumbs' => 'home']);
return view('frontend.' . config('template') . '.home', ['products' => Product::where('status', 1)->limit(3)->get(), 'breadcrumbs' => 'home']);
}
}
}
5 changes: 3 additions & 2 deletions app/Frontend/Controllers/PageController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace App\Http\Controllers\Frontend;

use App\Http\Controllers\Controller;
Expand All @@ -14,6 +15,6 @@ class PageController extends Controller
public function index($slug)
{
$pages = Page::where('slug', $slug)->first();
return view('frontend.'.config('template').'.pages', compact('pages'));
return view('frontend.' . config('template') . '.pages', compact('pages'));
}
}
}
13 changes: 7 additions & 6 deletions app/Frontend/Controllers/SearchController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace App\Http\Controllers\Frontend;

use App\Models\Shop\Product;
Expand All @@ -11,16 +12,16 @@ public function index(Request $request)
{
$text = $request->story;

if ( $text === null || empty($text) ) {
if ($text === null || empty($text)) {
return redirect()->route('home');
}
$products = Product::where('title', 'like', '%' . $text . '%')
->where('status', 1)
->orWhere('fulldesc', 'like', '%' . $text . '%')
->paginate(config('search_count'));
->where('status', 1)
->orWhere('fulldesc', 'like', '%' . $text . '%')
->paginate(config('search_count'));

$request->flash();

return view('frontend.'.config('template').'.search', ['products' => $products, 'phrase' => $text]);
return view('frontend.' . config('template') . '.search', ['products' => $products, 'phrase' => $text]);
}
}
}
Loading

0 comments on commit 8715f99

Please sign in to comment.