coding style
This commit is contained in:
@@ -17,7 +17,6 @@ class Order
|
||||
->setLabels(array_keys($data))
|
||||
->setDataset('CA', 'bar', array_values($data))
|
||||
->setColor('#334F17')
|
||||
->setStrokeColors(['#527C39'])
|
||||
;
|
||||
->setStrokeColors(['#527C39']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Shop\Article;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class FixSlug extends Command
|
||||
{
|
||||
|
||||
@@ -4,8 +4,8 @@ namespace App\Datatables\Admin\Shop;
|
||||
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Article;
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Repositories\Shop\ArticleImages;
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Repositories\Shop\Tags;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class ParentDataTable extends DataTable
|
||||
]);
|
||||
}
|
||||
|
||||
public function getButtonDel($field ='id', $title = 'Effacer')
|
||||
public function getButtonDel($field = 'id', $title = 'Effacer')
|
||||
{
|
||||
return view('components.form.buttons.delete', [
|
||||
'dataId' => '{{$'.$field.'}}',
|
||||
|
||||
@@ -41,7 +41,7 @@ class CustomerInvoicesDataTable extends DataTable
|
||||
'class' => 'btn-sm btn-secondary btn-invoice mr-2',
|
||||
'icon' => 'fa-file-pdf',
|
||||
'title' => 'Télécharger la facture',
|
||||
'url' => route('Shop.Invoices.pdf') . '/{{$uuid}}',
|
||||
'url' => route('Shop.Invoices.pdf').'/{{$uuid}}',
|
||||
]);
|
||||
|
||||
$buttons .= self::getButtonShow('uuid', 'Voir la facture');
|
||||
|
||||
@@ -29,6 +29,7 @@ class InvoicesDataTable extends DataTable
|
||||
})
|
||||
->editColumn('customer.last_name', function (Invoice $invoice) {
|
||||
$customer = $invoice->customer ?? false;
|
||||
|
||||
return $customer ? $customer->last_name.' '.$customer->first_name : '';
|
||||
})
|
||||
->rawColumns(['action']);
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Charts\Shop\Order;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\Dashboards;
|
||||
use App\Charts\Shop\Order;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -22,6 +22,7 @@ class HomeController extends Controller
|
||||
|
||||
$data = Dashboards::getStats($start, $end);
|
||||
$data['chart'] = Order::getMonthly();
|
||||
|
||||
// dump($data);
|
||||
// exit;
|
||||
return view('Admin.Shop.Dashboard.index', $data);
|
||||
|
||||
@@ -4,9 +4,9 @@ namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\Datatables\Admin\Shop\ArticlesDataTable;
|
||||
use App\Http\Requests\Admin\Shop\StoreArticlePost;
|
||||
use App\Repositories\Shop\ArticleInherited;
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Repositories\Shop\ArticleInherited;
|
||||
use App\Repositories\Shop\Categories;
|
||||
use App\Repositories\Shop\Tags;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\Datatables\Admin\Shop\InvoicePaymentsDataTable;
|
||||
use App\Datatables\Admin\Shop\InvoicesDataTable;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\Invoices;
|
||||
|
||||
@@ -19,6 +19,7 @@ class ArticleController extends Controller
|
||||
public function showBySlug($slug)
|
||||
{
|
||||
$id = Articles::getIDBySlug($slug);
|
||||
|
||||
return $id ? $this->show($id) : view('errors.404');
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Http\Controllers\Shop;
|
||||
|
||||
use App\Http\Controllers\Shop\Controller;
|
||||
use App\Repositories\Shop\Customers;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Http\Controllers\Shop;
|
||||
|
||||
use App\Http\Controllers\Shop\Controller;
|
||||
use App\Datatables\Shop\CustomerInvoicesDataTable;
|
||||
use App\Repositories\Shop\InvoicePDF;
|
||||
use App\Repositories\Shop\Invoices;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Http\Controllers\Shop;
|
||||
|
||||
use App\Datatables\Shop\CustomerOrdersDataTable;
|
||||
use App\Http\Controllers\Shop\Controller;
|
||||
use App\Repositories\Core\User\ShopCart;
|
||||
use App\Repositories\Shop\Baskets;
|
||||
use App\Repositories\Shop\Customers;
|
||||
@@ -71,8 +70,10 @@ class OrderController extends Controller
|
||||
return Paybox::makeAuthorizationRequest($order);
|
||||
}
|
||||
OrderMails::sendOrderConfirmed($order->id);
|
||||
|
||||
return redirect()->route('Shop.Orders.confirmed');
|
||||
}
|
||||
|
||||
return view('Shop.Orders.order');
|
||||
}
|
||||
|
||||
|
||||
@@ -223,11 +223,11 @@ class Article extends Model implements HasMedia
|
||||
$product = $this->product ?? false;
|
||||
|
||||
if (is_object($product)) {
|
||||
$description .= ' ' . $product ? $product->description : '';
|
||||
$description .= ' ' . $product ? $product->plus ?? '' : '';
|
||||
$description .= ' '.$product ? $product->description : '';
|
||||
$description .= ' '.$product ? $product->plus ?? '' : '';
|
||||
|
||||
$specie = $product ? $product->specie : false;
|
||||
$description .= ' ' . $specie ? $specie->description ?? '' : '';
|
||||
$description .= ' '.$specie ? $specie->description ?? '' : '';
|
||||
}
|
||||
|
||||
return [
|
||||
@@ -254,8 +254,8 @@ class Article extends Model implements HasMedia
|
||||
{
|
||||
return [
|
||||
'slug' => [
|
||||
'source' => 'name'
|
||||
]
|
||||
'source' => 'name',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function boot()
|
||||
{
|
||||
if(config('app.env') === 'production') {
|
||||
if (config('app.env') === 'production') {
|
||||
\URL::forceScheme('https');
|
||||
}
|
||||
Schema::defaultStringLength(191);
|
||||
|
||||
@@ -4,13 +4,6 @@ namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Article;
|
||||
use App\Models\Shop\Merchandise;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Botanic\Varieties;
|
||||
use App\Repositories\Core\Comments;
|
||||
use App\Repositories\Core\Tag;
|
||||
use App\Traits\Model\Basic;
|
||||
use App\Traits\Repository\Imageable;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ArticleCategories
|
||||
{
|
||||
|
||||
@@ -2,15 +2,10 @@
|
||||
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Article;
|
||||
use App\Models\Shop\Merchandise;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Botanic\Varieties;
|
||||
use App\Repositories\Core\Comments;
|
||||
use App\Repositories\Core\Tag;
|
||||
use App\Traits\Model\Basic;
|
||||
use App\Traits\Repository\Imageable;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ArticleImages
|
||||
{
|
||||
|
||||
@@ -3,14 +3,6 @@
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Article;
|
||||
use App\Models\Shop\Merchandise;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Botanic\Varieties;
|
||||
use App\Repositories\Core\Comments;
|
||||
use App\Repositories\Core\Tag;
|
||||
use App\Traits\Model\Basic;
|
||||
use App\Traits\Repository\Imageable;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ArticleSiblings
|
||||
{
|
||||
|
||||
@@ -2,15 +2,7 @@
|
||||
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Article;
|
||||
use App\Models\Shop\Merchandise;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Botanic\Varieties;
|
||||
use App\Repositories\Core\Comments;
|
||||
use App\Repositories\Core\Tag;
|
||||
use App\Traits\Model\Basic;
|
||||
use App\Traits\Repository\Imageable;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ArticleTags
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ class BasketStores
|
||||
|
||||
public function get($key)
|
||||
{
|
||||
if($this->has($key)) {
|
||||
if ($this->has($key)) {
|
||||
return new CartCollection(Basket::find($key)->cart_data);
|
||||
} else {
|
||||
return [];
|
||||
@@ -26,14 +26,14 @@ class BasketStores
|
||||
|
||||
public function put($key, $value)
|
||||
{
|
||||
if($row = Basket::find($key)) {
|
||||
if ($row = Basket::find($key)) {
|
||||
// update
|
||||
$row->cart_data = $value;
|
||||
$row->save();
|
||||
} else {
|
||||
Basket::create([
|
||||
'id' => $key,
|
||||
'cart_data' => $value
|
||||
'cart_data' => $value,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use LaravelDaily\Invoices\Invoice;
|
||||
use LaravelDaily\Invoices\Classes\Party;
|
||||
use LaravelDaily\Invoices\Classes\InvoiceItem;
|
||||
use LaravelDaily\Invoices\Classes\Party;
|
||||
use LaravelDaily\Invoices\Invoice;
|
||||
|
||||
class InvoicePDF
|
||||
{
|
||||
@@ -27,13 +27,13 @@ class InvoicePDF
|
||||
|
||||
$items = self::makeItems($invoice->order->detail);
|
||||
|
||||
$invoice = Invoice::make(__('invoices::invoice.invoice') . ' ' .$invoice->ref)
|
||||
$invoice = Invoice::make(__('invoices::invoice.invoice').' '.$invoice->ref)
|
||||
->status(Invoices::getStatus($invoice->status))
|
||||
->buyer($customer)
|
||||
->shipping($invoice->shipping)
|
||||
->date(Carbon::parse($invoice->date_invoice))
|
||||
->payUntilDays(14)
|
||||
->filename('invoice-' . $invoice->ref . '-' . $invoice->uuid)
|
||||
->filename('invoice-'.$invoice->ref.'-'.$invoice->uuid)
|
||||
->addItems($items)
|
||||
->notes($invoice->comment ?? '')
|
||||
->logo(public_path('img/logo.png'))
|
||||
@@ -48,7 +48,7 @@ class InvoicePDF
|
||||
|
||||
public static function makeAddress($address)
|
||||
{
|
||||
return $address->address . '<br>' . $address->zipcode . ' ' . $address->city;
|
||||
return $address->address.'<br>'.$address->zipcode.' '.$address->city;
|
||||
}
|
||||
|
||||
public static function makeItems($details)
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Offer;
|
||||
use App\Traits\Model\Basic;
|
||||
|
||||
class OfferStocks
|
||||
{
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace App\Repositories\Shop;
|
||||
use App\Models\Shop\Order;
|
||||
use App\Repositories\Core\DateStats;
|
||||
use App\Repositories\Core\PDF;
|
||||
use App\Repositories\Shop\Customers;
|
||||
use App\Traits\Model\Basic;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -30,7 +29,7 @@ class Orders
|
||||
|
||||
public static function getPdfByUUID($uuid)
|
||||
{
|
||||
return self::getPdf(self::getIdByUUID($uuid), 'commande-' . $uuid . '.pdf');
|
||||
return self::getPdf(self::getIdByUUID($uuid), 'commande-'.$uuid.'.pdf');
|
||||
}
|
||||
|
||||
public static function getPdf($id, $file = 'order.pdf')
|
||||
|
||||
@@ -12,6 +12,7 @@ class Searches
|
||||
'ids' => Article::search($options['search_name'])->get()->pluck('id'),
|
||||
]))->sortBy('searchOrder')->toArray();
|
||||
}
|
||||
|
||||
public static function getResults($options)
|
||||
{
|
||||
return Articles::getArticlesToSell($options);
|
||||
|
||||
@@ -108,6 +108,7 @@ return [
|
||||
'enable_php' => true,
|
||||
/**
|
||||
* Do not write log.html or make it optional
|
||||
*
|
||||
* @see https://github.com/dompdf/dompdf/issues/2810
|
||||
*/
|
||||
'logOutputFile' => '/dev/null',
|
||||
|
||||
@@ -136,7 +136,7 @@ return [
|
||||
'key' => env('MEILISEARCH_KEY', null),
|
||||
'index-settings' => [
|
||||
Article::class => [
|
||||
'filterableAttributes'=> ['article_nature_id'],
|
||||
'filterableAttributes' => ['article_nature_id'],
|
||||
'sortableAttributes' => ['name', 'created_at'],
|
||||
],
|
||||
],
|
||||
|
||||
@@ -17,7 +17,6 @@ return [
|
||||
*
|
||||
* Defaults to null, which uses the toString() method on your model.
|
||||
*/
|
||||
|
||||
'source' => null,
|
||||
|
||||
/**
|
||||
@@ -25,7 +24,6 @@ return [
|
||||
* no length restrictions are enforced. Set it to a positive integer if you
|
||||
* want to make sure your slugs aren't too long.
|
||||
*/
|
||||
|
||||
'maxLength' => null,
|
||||
|
||||
/**
|
||||
@@ -40,7 +38,6 @@ return [
|
||||
*
|
||||
* "my source string" -> "my-source-st"
|
||||
*/
|
||||
|
||||
'maxLengthKeepWords' => true,
|
||||
|
||||
/**
|
||||
@@ -58,13 +55,11 @@ return [
|
||||
*
|
||||
* 'method' => array('Str','slug'),
|
||||
*/
|
||||
|
||||
'method' => null,
|
||||
|
||||
/**
|
||||
* Separator to use when generating slugs. Defaults to a hyphen.
|
||||
*/
|
||||
|
||||
'separator' => '-',
|
||||
|
||||
/**
|
||||
@@ -76,7 +71,6 @@ return [
|
||||
* my-slug-1
|
||||
* my-slug-2
|
||||
*/
|
||||
|
||||
'unique' => true,
|
||||
|
||||
/**
|
||||
@@ -87,7 +81,6 @@ return [
|
||||
* "similar" slugs. The closure should return the new unique
|
||||
* suffix to append to the slug.
|
||||
*/
|
||||
|
||||
'uniqueSuffix' => null,
|
||||
|
||||
/**
|
||||
@@ -107,7 +100,6 @@ return [
|
||||
* If set to "false", then a new slug could duplicate one that exists on a trashed model.
|
||||
* If set to "true", then uniqueness is enforced across trashed and existing models.
|
||||
*/
|
||||
|
||||
'includeTrashed' => false,
|
||||
|
||||
/**
|
||||
@@ -133,7 +125,6 @@ return [
|
||||
*
|
||||
* and continue from there.
|
||||
*/
|
||||
|
||||
'reserved' => null,
|
||||
|
||||
/**
|
||||
@@ -146,7 +137,6 @@ return [
|
||||
* is probably not a good idea from an SEO point of view.
|
||||
* Only set this to true if you understand the possible consequences.
|
||||
*/
|
||||
|
||||
'onUpdate' => false,
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@ return new class extends Migration
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::connection($connection)->table($tableName, function(Blueprint $table) {
|
||||
Schema::connection($connection)->table($tableName, function (Blueprint $table) {
|
||||
$table->index('created_at');
|
||||
$table->index('batch');
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user