From 7df2421373ee46e8a97cc2828e0a9e528d42f626 Mon Sep 17 00:00:00 2001 From: Ludovic CANDELLIER Date: Fri, 11 Nov 2022 13:05:40 +0100 Subject: [PATCH] restart --- .../Auth/ConfirmPasswordController.php | 4 +- .../Admin/Auth/ForgotPasswordController.php | 38 ++++++ .../Admin/Auth/LoginController.php | 35 ++++++ .../Auth/PasswordSecurityController.php | 2 +- .../Admin/Auth/RegisterController.php | 76 +++++++++++ .../Admin/Auth/ResetPasswordController.php | 47 +++++++ .../Auth/VerificationController.php | 4 +- .../Admin/Shop/OrderController.php | 20 +-- .../Auth/ForgotPasswordController.php | 31 ++--- app/Http/Controllers/Auth/LoginController.php | 34 ++++- .../Controllers/Auth/RegisterController.php | 115 +++++++++-------- .../Auth/ResetPasswordController.php | 55 ++++---- .../Auth/VerificationController.php | 2 +- .../Controllers/Shop/ArticleController.php | 1 - .../Shop/Auth/ForgotPasswordController.php | 29 ----- .../Controllers/Shop/Auth/LoginController.php | 57 --------- .../Shop/Auth/RegisterController.php | 85 ------------- .../Shop/Auth/ResetPasswordController.php | 50 -------- .../Controllers/Shop/CustomerController.php | 3 +- app/Http/Controllers/Shop/OrderController.php | 12 +- .../Shop/OrderPaymentController.php | 18 +++ .../Controllers/Shop/PayboxController.php | 36 ++++++ app/Models/Shop/Customer.php | 1 + app/Repositories/Shop/Articles.php | 11 ++ app/Repositories/Shop/Baskets.php | 25 ++-- app/Repositories/Shop/CustomerStats.php | 5 +- app/Repositories/Shop/Customers.php | 10 ++ app/Repositories/Shop/Deliveries.php | 5 +- app/Repositories/Shop/InvoiceStats.php | 5 +- app/Repositories/Shop/Invoices.php | 8 +- app/Repositories/Shop/OrderDetails.php | 8 +- app/Repositories/Shop/OrderStats.php | 13 ++ app/Repositories/Shop/Orders.php | 20 ++- app/Repositories/Shop/Paybox.php | 53 ++++++++ composer.json | 4 +- config/app.php | 1 + config/boilerplate/app.php | 6 +- config/boilerplate/auth.php | 2 +- config/paybox.php | 118 ++++++++++++++++++ .../views/Admin/Shop/Orders/edit.blade.php | 69 +++++----- .../{Shop => Admin}/auth/firstlogin.blade.php | 0 .../{Shop => Admin}/auth/layout.blade.php | 7 -- resources/views/Admin/auth/login.blade.php | 14 +++ .../auth/partials/login.blade.php | 35 +++--- .../auth/passwords/change_password.blade.php | 0 .../Admin/auth/passwords/email.blade.php | 28 +++++ .../auth/passwords/reset.blade.php | 7 +- resources/views/Admin/auth/register.blade.php | 39 ++++++ .../{Shop => Admin}/auth/verify.blade.php | 0 resources/views/Shop/Baskets/basket.blade.php | 6 +- .../Customers/partials/deliveries.blade.php | 15 +++ .../Customers/partials/invoices.blade.php | 20 +++ .../Shop/Customers/partials/sale.blade.php | 19 +++ .../Shop/Customers/partials/user.blade.php | 10 ++ .../views/Shop/Customers/profile.blade.php | 8 +- .../Shelves/partials/category_add.blade.php | 28 ++++- resources/views/Shop/Shelves/shelve.blade.php | 2 +- resources/views/Shop/auth/login.blade.php | 14 --- .../views/Shop/auth/passwords/email.blade.php | 13 -- resources/views/Shop/auth/register.blade.php | 8 -- .../layout/partials/header-profile.blade.php | 6 +- resources/views/auth/layout.blade.php | 7 ++ resources/views/auth/login.blade.php | 12 +- resources/views/auth/partials/login.blade.php | 35 +++--- .../auth/partials/lost_password.blade.php | 4 +- .../auth/partials/register.blade.php | 4 +- .../views/auth/passwords/email.blade.php | 35 ++---- .../views/auth/passwords/reset.blade.php | 7 +- resources/views/auth/register.blade.php | 41 +----- .../views/components/form/button.blade.php | 16 ++- resources/views/paybox/aborted.blade.php | 9 ++ resources/views/paybox/accepted.blade.php | 9 ++ resources/views/paybox/refused.blade.php | 9 ++ resources/views/paybox/send.blade.php | 19 +++ resources/views/paybox/waiting.blade.php | 9 ++ .../vendor/boilerplate/auth/layout.blade.php | 1 + .../vendor/boilerplate/auth/login.blade.php | 8 +- .../boilerplate/components/input.blade.php | 17 ++- .../boilerplate/components/select2.blade.php | 27 +++- .../boilerplate/components/tinymce.blade.php | 10 +- .../layout/contentheader.blade.php | 54 ++++---- .../boilerplate/layout/footer.blade.php | 28 +++-- .../boilerplate/layout/header.blade.php | 55 ++------ .../vendor/boilerplate/layout/index.blade.php | 2 +- .../boilerplate/layout/mainsidebar.blade.php | 13 +- .../boilerplate/logs/dashboard.blade.php | 4 + .../vendor/boilerplate/logs/logs.blade.php | 2 +- .../vendor/boilerplate/logs/show.blade.php | 22 ++-- .../plugins/demo/codemirror.blade.php | 4 +- .../boilerplate/plugins/demo/icheck.blade.php | 36 +++--- .../vendor/boilerplate/roles/list.blade.php | 2 +- .../vendor/boilerplate/users/list.blade.php | 2 +- routes/Admin/Shop/Orders.php | 13 +- routes/Admin/Shop/route.php | 1 - routes/Shop/Baskets.php | 2 +- routes/Shop/Categories.php | 2 +- routes/Shop/Customers.php | 2 +- routes/Shop/Invoices.php | 2 +- routes/Shop/Offers.php | 2 +- routes/{Admin => }/Shop/OrderPayments.php | 0 routes/Shop/Searches.php | 4 +- routes/Shop/route.php | 16 +-- routes/paybox.php | 10 ++ routes/web.php | 22 +++- 104 files changed, 1212 insertions(+), 764 deletions(-) rename app/Http/Controllers/{Shop => Admin}/Auth/ConfirmPasswordController.php (91%) create mode 100644 app/Http/Controllers/Admin/Auth/ForgotPasswordController.php create mode 100644 app/Http/Controllers/Admin/Auth/LoginController.php rename app/Http/Controllers/{ => Admin}/Auth/PasswordSecurityController.php (98%) create mode 100644 app/Http/Controllers/Admin/Auth/RegisterController.php create mode 100644 app/Http/Controllers/Admin/Auth/ResetPasswordController.php rename app/Http/Controllers/{Shop => Admin}/Auth/VerificationController.php (92%) delete mode 100644 app/Http/Controllers/Shop/Auth/ForgotPasswordController.php delete mode 100644 app/Http/Controllers/Shop/Auth/LoginController.php delete mode 100644 app/Http/Controllers/Shop/Auth/RegisterController.php delete mode 100644 app/Http/Controllers/Shop/Auth/ResetPasswordController.php create mode 100644 app/Http/Controllers/Shop/OrderPaymentController.php create mode 100644 app/Http/Controllers/Shop/PayboxController.php create mode 100644 app/Repositories/Shop/OrderStats.php create mode 100644 app/Repositories/Shop/Paybox.php create mode 100644 config/paybox.php rename resources/views/{Shop => Admin}/auth/firstlogin.blade.php (100%) rename resources/views/{Shop => Admin}/auth/layout.blade.php (81%) create mode 100644 resources/views/Admin/auth/login.blade.php rename resources/views/{Shop => Admin}/auth/partials/login.blade.php (53%) rename resources/views/{Shop => Admin}/auth/passwords/change_password.blade.php (100%) create mode 100644 resources/views/Admin/auth/passwords/email.blade.php rename resources/views/{Shop => Admin}/auth/passwords/reset.blade.php (87%) create mode 100644 resources/views/Admin/auth/register.blade.php rename resources/views/{Shop => Admin}/auth/verify.blade.php (100%) create mode 100644 resources/views/Shop/Customers/partials/deliveries.blade.php create mode 100644 resources/views/Shop/Customers/partials/invoices.blade.php create mode 100644 resources/views/Shop/Customers/partials/sale.blade.php create mode 100644 resources/views/Shop/Customers/partials/user.blade.php delete mode 100644 resources/views/Shop/auth/login.blade.php delete mode 100644 resources/views/Shop/auth/passwords/email.blade.php delete mode 100644 resources/views/Shop/auth/register.blade.php rename resources/views/{Shop => }/auth/partials/lost_password.blade.php (76%) rename resources/views/{Shop => }/auth/partials/register.blade.php (98%) create mode 100644 resources/views/paybox/aborted.blade.php create mode 100644 resources/views/paybox/accepted.blade.php create mode 100644 resources/views/paybox/refused.blade.php create mode 100644 resources/views/paybox/send.blade.php create mode 100644 resources/views/paybox/waiting.blade.php rename routes/{Admin => }/Shop/OrderPayments.php (100%) create mode 100644 routes/paybox.php diff --git a/app/Http/Controllers/Shop/Auth/ConfirmPasswordController.php b/app/Http/Controllers/Admin/Auth/ConfirmPasswordController.php similarity index 91% rename from app/Http/Controllers/Shop/Auth/ConfirmPasswordController.php rename to app/Http/Controllers/Admin/Auth/ConfirmPasswordController.php index 038cbf3b..cafe9ff2 100644 --- a/app/Http/Controllers/Shop/Auth/ConfirmPasswordController.php +++ b/app/Http/Controllers/Admin/Auth/ConfirmPasswordController.php @@ -1,6 +1,6 @@ middleware('guest'); + } + + public function showLinkRequestForm() + { + $data = \App\Repositories\Config::init(); + return view('auth.passwords.email', $data); + } +} diff --git a/app/Http/Controllers/Admin/Auth/LoginController.php b/app/Http/Controllers/Admin/Auth/LoginController.php new file mode 100644 index 00000000..60019db4 --- /dev/null +++ b/app/Http/Controllers/Admin/Auth/LoginController.php @@ -0,0 +1,35 @@ +middleware('guest')->except('logout'); + $this->middleware('guest:web')->except('logout'); + } + + public function showLoginForm() + { + return view('auth.login'); + } + + public function authenticated(Request $request, $user) + { + return redirect()->intended($this->redirectPath()); + } + + public function username() + { + return 'username'; + } +} diff --git a/app/Http/Controllers/Auth/PasswordSecurityController.php b/app/Http/Controllers/Admin/Auth/PasswordSecurityController.php similarity index 98% rename from app/Http/Controllers/Auth/PasswordSecurityController.php rename to app/Http/Controllers/Admin/Auth/PasswordSecurityController.php index 6c873ccc..08203fa1 100644 --- a/app/Http/Controllers/Auth/PasswordSecurityController.php +++ b/app/Http/Controllers/Admin/Auth/PasswordSecurityController.php @@ -1,6 +1,6 @@ middleware('auth'); + } + + /** + * Get a validator for an incoming registration request. + * + * @param array $data + * @return \Illuminate\Contracts\Validation\Validator + */ + protected function validator(array $data) + { + return Validator::make( + $data, [ + 'name' => 'required|string|max:255', + 'email' => 'required|string|email|max:255|unique:users', + 'password' => 'required|string|min:6|confirmed', + ] + ); + } + + /** + * Create a new user instance after a valid registration. + * + * @param array $data + * @return \App\User + */ + protected function create(array $data) + { + return User::create( + [ + 'name' => $data['name'], + 'email' => $data['email'], + 'password' => Hash::make($data['password']), + ] + ); + } +} diff --git a/app/Http/Controllers/Admin/Auth/ResetPasswordController.php b/app/Http/Controllers/Admin/Auth/ResetPasswordController.php new file mode 100644 index 00000000..a8805215 --- /dev/null +++ b/app/Http/Controllers/Admin/Auth/ResetPasswordController.php @@ -0,0 +1,47 @@ +middleware('guest'); + } + + public function showResetForm(Request $request, $token = null) + { + $data['token'] = $token; + $data['email'] = $request->email; + return view('auth.passwords.reset', $data); + } +} diff --git a/app/Http/Controllers/Shop/Auth/VerificationController.php b/app/Http/Controllers/Admin/Auth/VerificationController.php similarity index 92% rename from app/Http/Controllers/Shop/Auth/VerificationController.php rename to app/Http/Controllers/Admin/Auth/VerificationController.php index a7ac017e..c99e296d 100644 --- a/app/Http/Controllers/Shop/Auth/VerificationController.php +++ b/app/Http/Controllers/Admin/Auth/VerificationController.php @@ -1,6 +1,6 @@ all()); - return redirect()->route('Admin.Shop.Orders.index'); - } - public function show($id) { $data = Orders::get($id); @@ -34,14 +28,20 @@ class OrderController extends Controller public function edit($id) { - $data['order'] = Orders::get($id, ['customer', 'detail'])->toArray(); - dump($data['order']); - exit; + $data['order'] = Orders::edit($id)->toArray(); + // dump($data); + // exit; return view('Admin.Shop.Orders.edit', $data); } + public function store(Request $request) + { + $ret = Orders::store($request->all()); + return redirect()->route('Admin.Shop.Orders.index'); + } + public function delete($id) { - return Orders::destroy($id); + return Orders::delete($id); } } diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index c39194c8..aee17b0c 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -3,36 +3,27 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; + use Illuminate\Foundation\Auth\SendsPasswordResetEmails; +use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Password; class ForgotPasswordController extends Controller { - /* - |-------------------------------------------------------------------------- - | Password Reset Controller - |-------------------------------------------------------------------------- - | - | This controller is responsible for handling password reset emails and - | includes a trait which assists in sending these notifications from - | your application to your users. Feel free to explore this trait. - | - */ - use SendsPasswordResetEmails; - /** - * Create a new controller instance. - * - * @return void - */ - public function __construct() + protected function guard() { - $this->middleware('guest'); + return Auth::guard('customer'); + } + + public function broker() + { + return Password::broker('customers'); } public function showLinkRequestForm() { - $data = \App\Repositories\Config::init(); - return view('auth.passwords.email', $data); + return view('Shop.auth.passwords.email'); } } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 7d6dd79a..63a36910 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -10,26 +10,48 @@ use Illuminate\Http\Request; class LoginController extends Controller { use AuthenticatesUsers; + protected $redirectTo = '/'; public function __construct() { - $this->middleware('guest')->except('logout'); - $this->middleware('guest:web')->except('logout'); + // $this->middleware('guest')->except('logout'); + } + + protected function guard() + { + return Auth::guard('customer'); } public function showLoginForm() { - return view('auth.login', $data ?? []); + return view('Shop.auth.login'); } - public function authenticated(Request $request, $user) + public function login(Request $request) { - return redirect()->intended($this->redirectPath()); + $credentials = $request->validate([ + 'email' => 'required|email', + 'password' => 'required|min:8', + ]); + + if ($this->guard()->attempt($credentials, $request->get('remember'))) { + $request->session()->regenerate(); + return (back()->getTargetUrl() == route('Shop.login')) ? redirect()->intended(route('home')) : back(); + } + return back()->withInput($request->only('email', 'remember')); + } + + public function logout(Request $request) + { + $sessionKey = $this->guard()->getName(); + $this->guard()->logout(); + $request->session()->forget($sessionKey); + return redirect()->route('home'); } public function username() { - return 'username'; + return 'email'; } } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 14e82aa3..ea683363 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -2,75 +2,84 @@ namespace App\Http\Controllers\Auth; -use App\User; use App\Http\Controllers\Controller; -use Illuminate\Support\Facades\Hash; -use Illuminate\Support\Facades\Validator; +use Carbon\Carbon; +use Illuminate\Contracts\Foundation\Application; +use Illuminate\Contracts\View\Factory; +use Illuminate\Contracts\View\View; +use Illuminate\Foundation\Auth\EmailVerificationRequest; use Illuminate\Foundation\Auth\RegistersUsers; +use Illuminate\Http\RedirectResponse; +use Illuminate\Http\Request; +use Illuminate\Routing\Redirector; +use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Validator; +use Sebastienheyd\Boilerplate\Rules\Password; + +use App\Models\Shop\Customer; class RegisterController extends Controller { - /* - |-------------------------------------------------------------------------- - | Register Controller - |-------------------------------------------------------------------------- - | - | This controller handles the registration of new users as well as their - | validation and creation. By default this controller uses a trait to - | provide this functionality without requiring any additional code. - | - */ - use RegistersUsers; - /** - * Where to redirect users after registration. - * - * @var string - */ - protected $redirectTo = '/home'; + protected $redirectTo; - /** - * Create a new controller instance. - * - * @return void - */ - public function __construct() + protected function guard() { - $this->middleware('auth'); + return Auth::guard('customer'); + } + + protected function redirectTo() + { + return route(config('boilerplate.app.redirectTo', 'boilerplate.dashboard')); } - /** - * Get a validator for an incoming registration request. - * - * @param array $data - * @return \Illuminate\Contracts\Validation\Validator - */ protected function validator(array $data) { - return Validator::make( - $data, [ - 'name' => 'required|string|max:255', - 'email' => 'required|string|email|max:255|unique:users', - 'password' => 'required|string|min:6|confirmed', - ] - ); + return Validator::make($data, [ + 'last_name' => 'required|max:255', + 'first_name' => 'required|max:255', + 'email' => 'required|email|max:255|unique:shop_customers,email,NULL,id,deleted_at,NULL', + 'password' => ['required', 'confirmed', new Password()], + ]); + } + + public function showRegistrationForm() + { + return view('Shop.auth.register', $data ?? []); } - /** - * Create a new user instance after a valid registration. - * - * @param array $data - * @return \App\User - */ protected function create(array $data) { - return User::create( - [ - 'name' => $data['name'], - 'email' => $data['email'], - 'password' => Hash::make($data['password']), - ] - ); + $user = Customer::withTrashed()->updateOrCreate(['email' => $data['email']], [ + 'active' => true, + 'first_name' => $data['first_name'], + 'last_name' => $data['last_name'], + 'email' => $data['email'], + 'password' => bcrypt($data['password']), + ]); + + return $user; + } + + public function emailVerify() + { + if (Auth::user()->hasVerifiedEmail()) { + return redirect(route(config('boilerplate.app.redirectTo', 'boilerplate.dashboard'))); + } + + return view('boilerplate::auth.verify-email'); + } + + public function emailVerifyRequest(EmailVerificationRequest $request) + { + $request->fulfill(); + return redirect(route(config('boilerplate.app.redirectTo', 'boilerplate.dashboard'))); + } + + public function emailSendVerification(Request $request) + { + $request->user()->sendEmailVerificationNotification(); + return back()->with('message', 'Verification link sent!'); } } diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index 15358f32..c00c135d 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -2,37 +2,19 @@ namespace App\Http\Controllers\Auth; -use Illuminate\Http\Request; use App\Http\Controllers\Controller; +use Illuminate\Http\Request; +use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Password; use Illuminate\Foundation\Auth\ResetsPasswords; +use App\Rules\Password as PasswordRules; class ResetPasswordController extends Controller { - /* - |-------------------------------------------------------------------------- - | Password Reset Controller - |-------------------------------------------------------------------------- - | - | This controller is responsible for handling password reset requests - | and uses a simple trait to include this behavior. You're free to - | explore this trait and override any methods you wish to tweak. - | - */ - use ResetsPasswords; - /** - * Where to redirect users after resetting their password. - * - * @var string - */ - protected $redirectTo = '/home'; + protected $redirectTo = '/'; - /** - * Create a new controller instance. - * - * @return void - */ public function __construct() { $this->middleware('guest'); @@ -40,8 +22,29 @@ class ResetPasswordController extends Controller public function showResetForm(Request $request, $token = null) { - $data['token'] = $token; - $data['email'] = $request->email; - return view('auth.passwords.reset', $data); + $token = $request->route()->parameter('token'); + + return view('Shop.auth.passwords.reset')->with( + ['token' => $token, 'email' => $request->email] + ); + } + + protected function rules() + { + return [ + 'token' => 'required', + 'email' => 'required|email', + 'password' => ['required', 'confirmed', new PasswordRules()], + ]; + } + + public function broker() + { + return Password::broker('customers'); + } + + protected function guard() + { + return Auth::guard('customer'); } } diff --git a/app/Http/Controllers/Auth/VerificationController.php b/app/Http/Controllers/Auth/VerificationController.php index 23a43a84..22aaf006 100644 --- a/app/Http/Controllers/Auth/VerificationController.php +++ b/app/Http/Controllers/Auth/VerificationController.php @@ -25,7 +25,7 @@ class VerificationController extends Controller * * @var string */ - protected $redirectTo = '/home'; + protected $redirectTo = '/'; /** * Create a new controller instance. diff --git a/app/Http/Controllers/Shop/ArticleController.php b/app/Http/Controllers/Shop/ArticleController.php index 61a34d27..f0788485 100644 --- a/app/Http/Controllers/Shop/ArticleController.php +++ b/app/Http/Controllers/Shop/ArticleController.php @@ -9,7 +9,6 @@ use App\Repositories\Shop\Articles; class ArticleController extends Controller { - public function show($id) { $data['article'] = Articles::getArticleToSell($id); diff --git a/app/Http/Controllers/Shop/Auth/ForgotPasswordController.php b/app/Http/Controllers/Shop/Auth/ForgotPasswordController.php deleted file mode 100644 index e348a1d7..00000000 --- a/app/Http/Controllers/Shop/Auth/ForgotPasswordController.php +++ /dev/null @@ -1,29 +0,0 @@ -middleware('guest')->except('logout'); - } - - protected function guard() - { - return Auth::guard('customer'); - } - - public function showLoginForm() - { - return view('Shop.auth.login'); - } - - public function login(Request $request) - { - $credentials = $request->validate([ - 'email' => 'required|email', - 'password' => 'required|min:8', - ]); - - if ($this->guard()->attempt($credentials, $request->get('remember'))) { - $request->session()->regenerate(); - return (back()->getTargetUrl() == route('Shop.login')) ? redirect()->intended(route('home')) : back(); - } - return back()->withInput($request->only('email', 'remember')); - } - - public function logout(Request $request) - { - $sessionKey = $this->guard()->getName(); - $this->guard()->logout(); - $request->session()->forget($sessionKey); - return redirect()->route('home'); - } - - public function username() - { - return 'email'; - } -} diff --git a/app/Http/Controllers/Shop/Auth/RegisterController.php b/app/Http/Controllers/Shop/Auth/RegisterController.php deleted file mode 100644 index 7a40a159..00000000 --- a/app/Http/Controllers/Shop/Auth/RegisterController.php +++ /dev/null @@ -1,85 +0,0 @@ - 'required|max:255', - 'first_name' => 'required|max:255', - 'email' => 'required|email|max:255|unique:shop_customers,email,NULL,id,deleted_at,NULL', - 'password' => ['required', 'confirmed', new Password()], - ]); - } - - public function showRegistrationForm() - { - return view('Shop.auth.register', $data ?? []); - } - - protected function create(array $data) - { - $user = Customer::withTrashed()->updateOrCreate(['email' => $data['email']], [ - 'active' => true, - 'first_name' => $data['first_name'], - 'last_name' => $data['last_name'], - 'email' => $data['email'], - 'password' => bcrypt($data['password']), - ]); - - return $user; - } - - public function emailVerify() - { - if (Auth::user()->hasVerifiedEmail()) { - return redirect(route(config('boilerplate.app.redirectTo', 'boilerplate.dashboard'))); - } - - return view('boilerplate::auth.verify-email'); - } - - public function emailVerifyRequest(EmailVerificationRequest $request) - { - $request->fulfill(); - return redirect(route(config('boilerplate.app.redirectTo', 'boilerplate.dashboard'))); - } - - public function emailSendVerification(Request $request) - { - $request->user()->sendEmailVerificationNotification(); - return back()->with('message', 'Verification link sent!'); - } -} diff --git a/app/Http/Controllers/Shop/Auth/ResetPasswordController.php b/app/Http/Controllers/Shop/Auth/ResetPasswordController.php deleted file mode 100644 index 2a3803c9..00000000 --- a/app/Http/Controllers/Shop/Auth/ResetPasswordController.php +++ /dev/null @@ -1,50 +0,0 @@ -middleware('guest'); - } - - public function showResetForm(Request $request, $token = null) - { - $token = $request->route()->parameter('token'); - - return view('Shop.auth.passwords.reset')->with( - ['token' => $token, 'email' => $request->email] - ); - } - - protected function rules() - { - return [ - 'token' => 'required', - 'email' => 'required|email', - 'password' => ['required', 'confirmed', new PasswordRules()], - ]; - } - - public function broker() - { - return Password::broker('customers'); - } - - protected function guard() - { - return Auth::guard('customer'); - } -} diff --git a/app/Http/Controllers/Shop/CustomerController.php b/app/Http/Controllers/Shop/CustomerController.php index fd838ab0..66228d84 100644 --- a/app/Http/Controllers/Shop/CustomerController.php +++ b/app/Http/Controllers/Shop/CustomerController.php @@ -11,6 +11,7 @@ class CustomerController extends Controller { public function profile($id = false) { - return view('Shop.Customers.profile'); + $data = Customers::editProfile($id); + return view('Shop.Customers.profile', $data); } } diff --git a/app/Http/Controllers/Shop/OrderController.php b/app/Http/Controllers/Shop/OrderController.php index 3c0fb146..fc0faff5 100644 --- a/app/Http/Controllers/Shop/OrderController.php +++ b/app/Http/Controllers/Shop/OrderController.php @@ -9,6 +9,7 @@ use App\Repositories\Core\User\ShopCart; use App\Repositories\Shop\Customers; use App\Repositories\Shop\Deliveries; use App\Repositories\Shop\Orders; +use App\Repositories\Shop\Paybox; use App\Repositories\Shop\Baskets; use App\Repositories\Shop\SaleChannels; @@ -30,13 +31,13 @@ class OrderController extends Controller { $data = $request->all(); $data['customer_id'] = Customers::getId(); - $data['basket'] = Baskets::getBasketSummary(); - dump($data); - exit; + $data['sale_channel_id'] = $data['sale_channel_id'] ?? SaleChannels::getDefaultID(); + $data['basket'] = Baskets::getBasketSummary($data['sale_channel_id']); $order = Orders::saveOrder($data); if ($order) { - if ($data['payment'] == '1') { - return redirect()->route('Shop.Payments.online'); + if ($data['payment_type'] == '1') { + return Paybox::makeAuthorizationRequest($data['basket']['total_shipped']); + // return redirect()->route('Shop.Payments.online'); } else { return redirect()->route('Shop.Orders.confirmed'); } @@ -47,6 +48,7 @@ class OrderController extends Controller public function confirmed() { + ShopCart::clear(); return view('Shop.Orders.confirmed'); } } diff --git a/app/Http/Controllers/Shop/OrderPaymentController.php b/app/Http/Controllers/Shop/OrderPaymentController.php new file mode 100644 index 00000000..440232ba --- /dev/null +++ b/app/Http/Controllers/Shop/OrderPaymentController.php @@ -0,0 +1,18 @@ + $homepage], $id); } + + public static function getNumericHash($id) + { + return hexdec(self::getHash($id)); + } + + public static function getHash($id) + { + $name = self::get($id)->name ?? false; + return $name ? hash('crc32c', Str::slug($name)) : false; + } } diff --git a/app/Repositories/Shop/Baskets.php b/app/Repositories/Shop/Baskets.php index 38b6b8b2..4001f0db 100644 --- a/app/Repositories/Shop/Baskets.php +++ b/app/Repositories/Shop/Baskets.php @@ -16,39 +16,44 @@ class Baskets return $data ? ShopCart::add($data, $update) : false; } - public static function getBasketSummary() + public static function getBasketSummary($sale_channel_id = false) { $basket = ShopCart::getContent(); $offers = Offer::with('variation')->whereIn('id', ShopCart::keys())->get(); $total = 0; $total_taxed = 0; + $shipping = 5; foreach ($basket as $item) { $offer = $offers->where('id', $item->id)->first(); + $prices = Offers::getPrice($item->id, $item->quantity, $sale_channel_id); $detail[] = [ - 'id' => (int) $item->id, + 'offer_id' => (int) $item->id, 'name' => $offer->article->name . ' (' . $offer->variation->name . ')', 'quantity' => (int) $item->quantity, - 'price' => $item->price, - 'tax' => '', - 'price_taxed' => $item->price, - 'total' => self::getTotal($item->quantity, $item->price), - 'total_taxed' => self::getTotal($item->quantity, $item->price), + 'price' => (float) $prices->price, + 'tax' => $prices->price_taxed - $prices->price, + 'price_taxed' => (float) $prices->price_taxed, + 'total' => self::getTotal($item->quantity, $prices->price), + 'total_tax' => self::getTotal($item->quantity, $prices->price_taxed - $prices->price), + 'total_taxed' => self::getTotal($item->quantity, $prices->price_taxed), ]; - $total += self::getTotal($item->quantity, $item->price); - $total_taxed += self::getTotal($item->quantity, $item->price); + $total += self::getTotal($item->quantity, $prices->price); + $total_taxed += self::getTotal($item->quantity, $prices->price_taxed); } $data = [ 'detail' => $detail, 'total' => $total, 'taxes' => $total_taxed - $total, 'total_taxed' => $total_taxed, + 'shipping' => $shipping, + 'total_shipped' => $total_taxed + $shipping, ]; return $data ?? false; } public static function getTotal($quantity, $price) { - return (int) $quantity * $price; + return $quantity * $price; } public static function getBasket($sale_channel_id = false) diff --git a/app/Repositories/Shop/CustomerStats.php b/app/Repositories/Shop/CustomerStats.php index 47e1e4c3..11ecb119 100644 --- a/app/Repositories/Shop/CustomerStats.php +++ b/app/Repositories/Shop/CustomerStats.php @@ -4,9 +4,10 @@ namespace App\Repositories\Shop; use Spatie\Stats\BaseStats; -class CustomerStats extends BaseStats {} +class CustomerStats extends BaseStats { - public function getName() : string{ + public function getName() : string + { return 'customers'; } } diff --git a/app/Repositories/Shop/Customers.php b/app/Repositories/Shop/Customers.php index c3de97ac..b5fefe1b 100644 --- a/app/Repositories/Shop/Customers.php +++ b/app/Repositories/Shop/Customers.php @@ -12,6 +12,16 @@ use App\Models\Shop\Customer; class Customers { + public static function editProfile($id = false) + { + $id = $id ? $id : self::getId(); + $data = [ + 'customer' => self::get($id, ['addresses', 'deliveries', 'orders'])->toArray(), + 'deliveries' => Deliveries::getAll('sale_channel')->toArray(), + ]; + dump($data); + return $data; + } public static function getAvatar($id = false) { diff --git a/app/Repositories/Shop/Deliveries.php b/app/Repositories/Shop/Deliveries.php index 2e6042f5..efba3df3 100644 --- a/app/Repositories/Shop/Deliveries.php +++ b/app/Repositories/Shop/Deliveries.php @@ -11,9 +11,10 @@ class Deliveries return Delivery::orderBy('name', 'asc')->get()->pluck('name', 'id')->toArray(); } - public static function getAll() + public static function getAll($relations = false) { - return Delivery::orderBy('name', 'asc')->get(); + $model = $relations ? Delivery::with($relations) : Delivery::query(); + return $model->orderBy('name', 'asc')->get(); } public static function getAllWithSaleChannel() diff --git a/app/Repositories/Shop/InvoiceStats.php b/app/Repositories/Shop/InvoiceStats.php index cf71ae0e..1679d0cb 100644 --- a/app/Repositories/Shop/InvoiceStats.php +++ b/app/Repositories/Shop/InvoiceStats.php @@ -4,9 +4,10 @@ namespace App\Repositories\Shop; use Spatie\Stats\BaseStats; -class InvoiceStats extends BaseStats {} +class InvoiceStats extends BaseStats { - public function getName() : string{ + public function getName() : string + { return 'invoices'; } } diff --git a/app/Repositories/Shop/Invoices.php b/app/Repositories/Shop/Invoices.php index 660281f8..cc1db812 100644 --- a/app/Repositories/Shop/Invoices.php +++ b/app/Repositories/Shop/Invoices.php @@ -8,12 +8,9 @@ use App\Models\Shop\Invoice; class Invoices { - public static function saveInvoice($order_id, $data) { $data['order_id'] = $order_id; - dump($data); - exit; return self::store($data); } @@ -29,6 +26,7 @@ class Invoices public static function create($data) { + InvoiceStats::increase($data['total_taxed']); $data['uuid'] = Str::uuid()->toString(); $data['ref'] = self::getNewRef(); return Invoice::create($data); @@ -44,6 +42,8 @@ class Invoices public static function delete($id) { + $invoice = self::get($id); + InvoiceStats::decrease($invoice->total_priced); return Invoice::destroy($id); } @@ -51,6 +51,6 @@ class Invoices { $ref = date('ym') . '00000'; $last_ref = Invoice::orderBy('ref', 'desc')->where('ref', '>', $ref)->first(); - return $last_ref ? $last_ref + 1 : $ref + 1; + return $last_ref ? $last_ref->ref + 1 : $ref + 1; } } diff --git a/app/Repositories/Shop/OrderDetails.php b/app/Repositories/Shop/OrderDetails.php index 41b37304..61e37604 100644 --- a/app/Repositories/Shop/OrderDetails.php +++ b/app/Repositories/Shop/OrderDetails.php @@ -9,12 +9,8 @@ class OrderDetails public static function saveBasket($order_id, $data) { foreach ($data as $item) { - $detail = self::store([ - 'order_id' => $order_id, - 'offer_id' => $item['id'], - 'quantity' => $item['quantity'], - 'price_taxed' => $item['price'], - ]); + $item['order_id'] = $order_id; + $detail = self::store($item); } return true; } diff --git a/app/Repositories/Shop/OrderStats.php b/app/Repositories/Shop/OrderStats.php new file mode 100644 index 00000000..b27cab25 --- /dev/null +++ b/app/Repositories/Shop/OrderStats.php @@ -0,0 +1,13 @@ +id, $data); - return $order ? OrderDetails::saveBasket($order->id, $basket) : false; + $detail = OrderDetails::saveBasket($order->id, $basket['detail']); + unset($data['comment']); + unset($data['agree']); + unset($data['customer_id']); + unset($data['delivery_id']); + unset($data['detail']); + unset($data['payment_type']); + unset($data['sale_channel_id']); + return ($order && $detail) ? Invoices::saveInvoice($order->id, $data) : false; + } + + public static function edit($id) + { + return Orders::get($id, ['customer', 'address', 'delivery', 'detail']); } public static function get($id, $relations = false) @@ -30,6 +41,7 @@ class Orders public static function create($data) { + OrderStats::increase(); return Order::create($data); } diff --git a/app/Repositories/Shop/Paybox.php b/app/Repositories/Shop/Paybox.php new file mode 100644 index 00000000..fa110120 --- /dev/null +++ b/app/Repositories/Shop/Paybox.php @@ -0,0 +1,53 @@ +setAmount($amount)->setCustomerEmail($customer_email) + ->setPaymentNumber(1)->send('paybox.send'); + } + + public static function verifyPayment($invoice_id) + { + $invoice = Invoices::get($invoice_id); + $payboxVerify = App::make(Verify::class); + try { + $success = $payboxVerify->isSuccess($invoice->total_shipped); + if ($success) { + // process order here after making sure it was real payment + } + echo "OK"; + } + catch (InvalidSignature $e) { + Log::alert('Invalid payment signature detected'); + } + } + + public static function getPreviousAuthorizedRequest() + { + $payment = PaymentModel::find($idOfAuthorizedPayment); + $captureRequest = App::make(Capture::class); + $response = $captureRequest->setAmount($payment->amount) + ->setPayboxCallNumber($payment->call_number) + ->setPayboxTransactionNumber($payment->transaction_number) + ->setDayRequestNumber(2) + ->send(); + + if ($response->isSuccess()) { + // process order here + } + } + +} diff --git a/composer.json b/composer.json index d52bcb2b..f2633822 100644 --- a/composer.json +++ b/composer.json @@ -14,6 +14,7 @@ "arcanedev/log-viewer": "^8.1", "arrilot/laravel-widgets": "^3.13", "awobaz/compoships": "^2.1", + "balping/laravel-hashslug": "^2.2", "barryvdh/laravel-dompdf": "^0.9", "barryvdh/laravel-snappy": "^0.4.7", "box/spout": "^3.3", @@ -21,7 +22,6 @@ "cesargb/laravel-cascade-delete": "^1.2", "coduo/php-humanizer": "^4.0", "composer/composer": "^2.0.13", - "consoletvs/charts": "^7.2", "cornford/googlmapper": "^3.3", "darryldecode/cart": "^4.1", "datatables/datatables": "^1.10", @@ -63,6 +63,7 @@ "mpdf/mpdf": "^8.0", "mpociot/teamwork": "^6.1", "nicmart/tree": "^0.3", + "nicolaslopezj/searchable": "^1.13", "orangehill/iseed": "^3.0", "php-console/php-console": "^3.1", "proengsoft/laravel-jsvalidation": "^4.5", @@ -84,6 +85,7 @@ "spatie/image-optimizer": "^1.4", "spatie/laravel-activitylog": "^3.6", "spatie/laravel-backup": "^7.0", + "spatie/laravel-collection-macros": "^7.12", "spatie/laravel-cookie-consent": "^3.2", "spatie/laravel-mail-preview": "^4.0", "spatie/laravel-medialibrary": "^9.6", diff --git a/config/app.php b/config/app.php index 94044f34..5cb0062d 100644 --- a/config/app.php +++ b/config/app.php @@ -166,6 +166,7 @@ return [ * Package Service Providers... */ Darryldecode\Cart\CartServiceProvider::class, + Devpark\PayboxGateway\Providers\PayboxServiceProvider::class, /* * Application Service Providers... diff --git a/config/boilerplate/app.php b/config/boilerplate/app.php index 2db442aa..a251cf51 100644 --- a/config/boilerplate/app.php +++ b/config/boilerplate/app.php @@ -8,10 +8,14 @@ return [ 'domain' => '', // Redirect to this route after login - 'redirectTo' => 'home', + 'redirectTo' => 'Admin.home', // Backend locale 'locale' => config('app.locale'), 'logs' => true, + + // When set to true, allows admins to view the site as a user of their choice + 'allowImpersonate' => false, + ]; diff --git a/config/boilerplate/auth.php b/config/boilerplate/auth.php index dab66843..0e71e6e7 100644 --- a/config/boilerplate/auth.php +++ b/config/boilerplate/auth.php @@ -12,6 +12,6 @@ return [ ], 'throttle' => [ 'maxAttempts' => 3, // Maximum number of login attempts to allow - 'decayMinutes' => 1, // Number of minutes to wait before login will be available again + 'decayMinutes' => 5, // Number of minutes to wait before login will be available again ], ]; diff --git a/config/paybox.php b/config/paybox.php new file mode 100644 index 00000000..ab3e1d16 --- /dev/null +++ b/config/paybox.php @@ -0,0 +1,118 @@ + env('PAYBOX_TEST', false), + + /* + * Site number (provided by Paybox) + */ + 'site' => env('PAYBOX_SITE', ''), + + /* + * Rank number (provided by Paybox) + */ + 'rank' => env('PAYBOX_RANK', ''), + + /* + * Internal identifier (provided by Paybox) + */ + 'id' => env('PAYBOX_ID', ''), + + /* + * Password for Paybox back-office (It's required for Paybox direct - when you use + * capturing, otherwise it won't be used) + */ + 'back_office_password' => env('PAYBOX_BACK_OFFICE_PASSWORD', ''), + + /* + * HMAC authentication key - it should be generated in Paybox merchant panel + */ + 'hmac_key' => env('PAYBOX_HMAC_KEY', ''), + + /* + * Paybox public key location - you can get it from + * http://www1.paybox.com/wp-content/uploads/2014/03/pubkey.pem + */ + 'public_key' => storage_path('paybox/pubkey.pem'), + + /* + * Default return fields when going back from Paybox. You can change here keys as you want, + * you can add also more values from ResponseField class + */ + 'return_fields' => [ + 'amount' => \Devpark\PayboxGateway\ResponseField::AMOUNT, + 'authorization_number' => \Devpark\PayboxGateway\ResponseField::AUTHORIZATION_NUMBER, + 'order_number' => \Devpark\PayboxGateway\ResponseField::ORDER_NUMBER, + 'response_code' => \Devpark\PayboxGateway\ResponseField::RESPONSE_CODE, + 'payment_type' => \Devpark\PayboxGateway\ResponseField::PAYMENT_TYPE, + 'call_number' => \Devpark\PayboxGateway\ResponseField::PAYBOX_CALL_NUMBER, + 'transaction_number' => \Devpark\PayboxGateway\ResponseField::TRANSACTION_NUMBER, + // signature should be always last return field + 'signature' => \Devpark\PayboxGateway\ResponseField::SIGNATURE, + ], + + /* + * Those are routes names (not urls) where customer will be redirected after payment. If you + * want to use custom route with params in url you should set them dynamically when creating + * authorization data. You shouldn't change keys here. Those urls will be later launched using + * GET HTTP request + */ + 'customer_return_routes_names' => [ + 'accepted' => 'paybox.accepted', + 'refused' => 'paybox.refused', + 'aborted' => 'paybox.aborted', + 'waiting' => 'paybox.waiting', + ], + + /* + * This is route name (not url) where Paybox will send transaction status. This url is + * independent from customer urls and it's the only url that should be used to track current + * payment status for real. If you want to use custom route with params in url you should set it + * dynamically when creating authorization data. This url will be later launched using GET HTTP + * request + */ + 'transaction_verify_route_name' => 'paybox.process', + + /* + * Access urls for Paybox for production environment + */ + 'production_urls' => [ + /* + * Paybox System urls + */ + 'paybox' => [ + 'https://tpeweb.e-transactions.fr/cgi/MYchoix_pagepaiement.cgi', + 'https://tpeweb1.e-transactions.fr/cgi/MYchoix_pagepaiement.cgi', + ], + + /* + * Paybox Direct urls + */ + 'paybox_direct' => [ + 'https://ppps.e-transactions.fr/PPPS.php', + 'https://ppps1.e-transactions.fr/PPPS.php', + ], + ], + + /* + * Access urls for Paybox for test environment + */ + 'test_urls' => [ + /* + * Paybox System urls + */ + 'paybox' => [ + 'https://preprod-tpeweb.e-transactions.fr/cgi/MYchoix_pagepaiement.cgi', + ], + + /* + * Paybox Direct urls + */ + 'paybox_direct' => [ + 'https://preprod-ppps.e-transactions.fr/PPPS.php', + ], + ], +]; diff --git a/resources/views/Admin/Shop/Orders/edit.blade.php b/resources/views/Admin/Shop/Orders/edit.blade.php index f3a2cc03..5eefd822 100644 --- a/resources/views/Admin/Shop/Orders/edit.blade.php +++ b/resources/views/Admin/Shop/Orders/edit.blade.php @@ -5,45 +5,48 @@ ]) @section('content') - {{ Form::open(['route' => 'Admin.Shop.Orders.update', 'id' => 'order-form', 'autocomplete' => 'off']) }} - + -
-
- {{ $order['last_name'] }} {{ $order['first_name'] }} -
-
- -
-
- {{ $order['delivery']['name'] }} -
-
- -
-
- {{ $order['address'] }}
- {{ $order['address2'] }}
- {{ $order['zipcode'] }} {{ $order['city'] }}
-
-
- - + +

{{ $order['customer']['last_name'] }} {{ $order['customer']['first_name'] }}

+ +

{{ $order['delivery']['name'] }}

- - @foreach ($order['details'] as $detail) - - - - - - - @endforeach -
{{ $detail['quantity'] }}{{ $detail['name'] }}{{ $detail['price'] }}{{ $detail['total'] }}
+ @if ($order['address']) + {{ $order['address']['address'] }}
+ @isset ($order['address']['address2']) {{ $order['address']['address2'] }}
@endisset + {{ $order['address']['zipcode'] }} {{ $order['address']['city'] }}
+ @endif
+ + + +
+
+ + + + + + + + + @foreach ($order['detail'] as $detail) + + + + + + + @endforeach + +
QuantitéNomPrixTotal
{{ $detail['quantity'] }}{{ $detail['name'] }}{{ $detail['price'] }}{{ $detail['total'] }}
+
+
+
diff --git a/resources/views/Shop/auth/firstlogin.blade.php b/resources/views/Admin/auth/firstlogin.blade.php similarity index 100% rename from resources/views/Shop/auth/firstlogin.blade.php rename to resources/views/Admin/auth/firstlogin.blade.php diff --git a/resources/views/Shop/auth/layout.blade.php b/resources/views/Admin/auth/layout.blade.php similarity index 81% rename from resources/views/Shop/auth/layout.blade.php rename to resources/views/Admin/auth/layout.blade.php index 614e587c..89fcf408 100644 --- a/resources/views/Shop/auth/layout.blade.php +++ b/resources/views/Admin/auth/layout.blade.php @@ -11,13 +11,6 @@ @stack('css') - -
-
- -
-
- @yield('content') @stack('js') diff --git a/resources/views/Admin/auth/login.blade.php b/resources/views/Admin/auth/login.blade.php new file mode 100644 index 00000000..cf0156d5 --- /dev/null +++ b/resources/views/Admin/auth/login.blade.php @@ -0,0 +1,14 @@ +@extends('auth.layout', [ + 'title' => __('boilerplate::auth.login.title'), + 'bodyClass' => 'hold-transition login-page' +]) + +@section('content') +
+
+ +
+
+ + @include('Admin.auth.partials.login') +@endsection diff --git a/resources/views/Shop/auth/partials/login.blade.php b/resources/views/Admin/auth/partials/login.blade.php similarity index 53% rename from resources/views/Shop/auth/partials/login.blade.php rename to resources/views/Admin/auth/partials/login.blade.php index a421619f..0d255f62 100644 --- a/resources/views/Shop/auth/partials/login.blade.php +++ b/resources/views/Admin/auth/partials/login.blade.php @@ -1,42 +1,35 @@ -{!! Form::open(['route' => 'Shop.login.post', 'method' => 'post', 'autocomplete'=> 'off']) !!} +{!! Form::open(['route' => 'boilerplate.login', 'method' => 'post', 'autocomplete'=> 'off']) !!}
-
+
{{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }} -
- -
+ {!! $errors->first('email','

:message

') !!}
-
+
{{ Form::password('password', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password')]) }} -
- -
+ {!! $errors->first('password','

:message

') !!}
-
- -
- - +
+
{!! Form::close() !!} + +{{ __('boilerplate::auth.login.forgotpassword') }}
+@if(config('boilerplate.auth.register')) + {{ __('boilerplate::auth.login.register') }} +@endif diff --git a/resources/views/Shop/auth/passwords/change_password.blade.php b/resources/views/Admin/auth/passwords/change_password.blade.php similarity index 100% rename from resources/views/Shop/auth/passwords/change_password.blade.php rename to resources/views/Admin/auth/passwords/change_password.blade.php diff --git a/resources/views/Admin/auth/passwords/email.blade.php b/resources/views/Admin/auth/passwords/email.blade.php new file mode 100644 index 00000000..59f59270 --- /dev/null +++ b/resources/views/Admin/auth/passwords/email.blade.php @@ -0,0 +1,28 @@ +@extends('boilerplate::auth.layout', ['title' => __('boilerplate::auth.password.title'), 'bodyClass' => 'hold-transition login-page']) + +@section('content') + @component('boilerplate::auth.loginbox') + + @if (session('status')) +
+ {{ session('status') }} +
+ @endif + {!! Form::open(['route' => 'boilerplate.password.email', 'method' => 'post', 'autocomplete'=> 'off']) !!} +
+ {{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }} + {!! $errors->first('email','

:message

') !!} +
+
+
+
+ +
+
+
+ {!! Form::close() !!} + {{ __('boilerplate::auth.password.login_link') }}
+ @endcomponent +@endsection diff --git a/resources/views/Shop/auth/passwords/reset.blade.php b/resources/views/Admin/auth/passwords/reset.blade.php similarity index 87% rename from resources/views/Shop/auth/passwords/reset.blade.php rename to resources/views/Admin/auth/passwords/reset.blade.php index a905c2c1..97fde9d7 100644 --- a/resources/views/Shop/auth/passwords/reset.blade.php +++ b/resources/views/Admin/auth/passwords/reset.blade.php @@ -1,12 +1,9 @@ -@extends('Shop.auth.layout', [ - 'title' => __('boilerplate::auth.password_reset.title'), - 'bodyClass' => 'hold-transition login-page' -]) +@extends('boilerplate::auth.layout', ['title' => __('boilerplate::auth.password_reset.title')]) @section('content') @component('boilerplate::auth.loginbox') - {!! Form::open(['route' => 'Shop.password.update', 'method' => 'post', 'autocomplete'=> 'off']) !!} + {!! Form::open(['route' => 'Shop.password.reset.post', 'method' => 'post', 'autocomplete'=> 'off']) !!} {!! Form::hidden('token', $token) !!}
{{ Form::email('email', old('email', $email), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }} diff --git a/resources/views/Admin/auth/register.blade.php b/resources/views/Admin/auth/register.blade.php new file mode 100644 index 00000000..86c3bc67 --- /dev/null +++ b/resources/views/Admin/auth/register.blade.php @@ -0,0 +1,39 @@ +@extends('boilerplate::auth.layout', ['title' => __('boilerplate::auth.register.title'), 'bodyClass' => 'hold-transition login-page']) + +@section('content') + @component('boilerplate::auth.loginbox') + + {!! Form::open(['route' => 'boilerplate.register', 'method' => 'post', 'autocomplete'=> 'off']) !!} +
+ {{ Form::text('first_name', old('first_name'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.first_name'), 'required', 'autofocus']) }} + {!! $errors->first('first_name','

:message

') !!} +
+
+ {{ Form::text('last_name', old('last_name'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.last_name'), 'required']) }} + {!! $errors->first('last_name','

:message

') !!} +
+
+ {{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required']) }} + {!! $errors->first('email','

:message

') !!} +
+
+ {{ Form::password('password', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password'), 'required']) }} + {!! $errors->first('password','

:message

') !!} +
+
+ {{ Form::password('password_confirmation', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password_confirm'), 'required']) }} + {!! $errors->first('password_confirmation','

:message

') !!} +
+
+
+ +
+
+ {!! Form::close() !!} + @if(!$firstUser) + {{ __('boilerplate::auth.register.login_link') }}
+ @endif + @endcomponent +@endsection diff --git a/resources/views/Shop/auth/verify.blade.php b/resources/views/Admin/auth/verify.blade.php similarity index 100% rename from resources/views/Shop/auth/verify.blade.php rename to resources/views/Admin/auth/verify.blade.php diff --git a/resources/views/Shop/Baskets/basket.blade.php b/resources/views/Shop/Baskets/basket.blade.php index 013440e1..30c35b4e 100644 --- a/resources/views/Shop/Baskets/basket.blade.php +++ b/resources/views/Shop/Baskets/basket.blade.php @@ -49,9 +49,7 @@ $('.basket-quantity').change(function() { var offer_id = $(this).data('id'); var quantity = $(this).val(); - var $row = $(this).parents('.row'); - console.log("add basket"); - console.log(quantity); + var $row = $(this).closest('.row'); updateBasket(offer_id, quantity, function() { calculatePrice($row); calculateTotal(); @@ -73,8 +71,6 @@ } function calculatePrice($that) { - console.log('calculatePrice'); - console.log($that); var quantity = $that.find('.basket-quantity').val(); var price = $that.find('.basket-price').text(); var total_price = fixNumber(quantity * price); diff --git a/resources/views/Shop/Customers/partials/deliveries.blade.php b/resources/views/Shop/Customers/partials/deliveries.blade.php new file mode 100644 index 00000000..c6bc8674 --- /dev/null +++ b/resources/views/Shop/Customers/partials/deliveries.blade.php @@ -0,0 +1,15 @@ +@foreach ($deliveries as $delivery) +
+
+ @include('components.form.radios.icheck', [ + 'name' => 'delivery_id', + 'value' => $delivery['id'], + 'checked' => $customer['sale_delivery_id'] ?? false, + ]) +
+
+ {{ $delivery['name'] }} - {{ $delivery['sale_channel']['name'] }}
+

{{ $delivery['description'] }}

+
+
+@endforeach diff --git a/resources/views/Shop/Customers/partials/invoices.blade.php b/resources/views/Shop/Customers/partials/invoices.blade.php new file mode 100644 index 00000000..ee53666c --- /dev/null +++ b/resources/views/Shop/Customers/partials/invoices.blade.php @@ -0,0 +1,20 @@ +
+ @if ($customer['orders'] ?? false) + @foreach ($customer['orders'] as $order) +
+
+
+
+ Numero facture +
+
+ Date facture +
+ +
+ @endforeach + @endif +
\ No newline at end of file diff --git a/resources/views/Shop/Customers/partials/sale.blade.php b/resources/views/Shop/Customers/partials/sale.blade.php new file mode 100644 index 00000000..84b0c35d --- /dev/null +++ b/resources/views/Shop/Customers/partials/sale.blade.php @@ -0,0 +1,19 @@ + + +
+
+ @include('Shop.Customers.partials.deliveries') +
+
+ @include('Shop.Customers.partials.invoices') +
+
diff --git a/resources/views/Shop/Customers/partials/user.blade.php b/resources/views/Shop/Customers/partials/user.blade.php new file mode 100644 index 00000000..bd8ed870 --- /dev/null +++ b/resources/views/Shop/Customers/partials/user.blade.php @@ -0,0 +1,10 @@ +
+Mes coordonnées
+ + {{ $customer['address'] }}
+ {{ $customer['address2'] }}
+ + {{ $customer['phone'] }}
+ {{ $customer['email'] }}
+
+Compte créé le {{ $customer['created_at'] }} \ No newline at end of file diff --git a/resources/views/Shop/Customers/profile.blade.php b/resources/views/Shop/Customers/profile.blade.php index 2753d172..fb3ee17e 100644 --- a/resources/views/Shop/Customers/profile.blade.php +++ b/resources/views/Shop/Customers/profile.blade.php @@ -3,5 +3,11 @@ ]) @section('content') -Profil +
+
+ @include('Shop.Customers.partials.user') +
+
+ @include('Shop.Customers.partials.sale') +
@endsection diff --git a/resources/views/Shop/Shelves/partials/category_add.blade.php b/resources/views/Shop/Shelves/partials/category_add.blade.php index a66afd27..1df0814f 100644 --- a/resources/views/Shop/Shelves/partials/category_add.blade.php +++ b/resources/views/Shop/Shelves/partials/category_add.blade.php @@ -1,13 +1,33 @@
@if ($display_by_rows ?? false) - @include('components.form.button', ['id' => 'by_cards', 'icon' => 'fa-th', 'class' => 'btn-secondary']) + @include('components.form.button', [ + 'id' => 'by_cards', + 'icon' => 'fa-th', + 'class' => 'btn-secondary', + 'title' => 'Vue par vignettes', + ]) @else - @include('components.form.button', ['id' => 'by_rows', 'icon' => 'fa-list', 'class' => 'btn-secondary']) + @include('components.form.button', [ + 'id' => 'by_rows', + 'icon' => 'fa-list', + 'class' => 'btn-secondary', + 'title' => 'Vue par lignes', + ]) @endif - @include('components.form.button', ['data_id' => 'botanic', 'icon' => 'fa-leaf', 'class' => 'products bg-yellow yellow-dark']) - @include('components.form.button', ['data_id' => 'merchandise', 'icon' => 'fa-seedling', 'class' => 'products bg-green text-white']) + @include('components.form.button', [ + 'data_id' => 'botanic', + 'icon' => 'fa-leaf', + 'class' => 'products bg-yellow yellow-dark', + 'title' => 'Par semences', + ]) + @include('components.form.button', [ + 'data_id' => 'merchandise', + 'icon' => 'fa-seedling', + 'class' => 'products bg-green text-white', + 'title' => 'Par plants', + ])
diff --git a/resources/views/Shop/Shelves/shelve.blade.php b/resources/views/Shop/Shelves/shelve.blade.php index d98f25b6..e475bd74 100644 --- a/resources/views/Shop/Shelves/shelve.blade.php +++ b/resources/views/Shop/Shelves/shelve.blade.php @@ -35,7 +35,7 @@ @else @include('Shop.Shelves.partials.category_articles') @endif - + {{ Form::close() }} @endsection diff --git a/resources/views/Shop/auth/login.blade.php b/resources/views/Shop/auth/login.blade.php deleted file mode 100644 index 7e69b3c7..00000000 --- a/resources/views/Shop/auth/login.blade.php +++ /dev/null @@ -1,14 +0,0 @@ -@extends('Shop.auth.layout', [ - 'title' => __('boilerplate::auth.login.title'), - 'bodyClass' => 'hold-transition login-page' -]) - -@section('content') - - @include('Shop.auth.partials.login') - -

- Vous n'avez pas encore de compte ? - {{ __('Inscrivez-vous') }} -

-@endsection diff --git a/resources/views/Shop/auth/passwords/email.blade.php b/resources/views/Shop/auth/passwords/email.blade.php deleted file mode 100644 index 6103e523..00000000 --- a/resources/views/Shop/auth/passwords/email.blade.php +++ /dev/null @@ -1,13 +0,0 @@ -@extends('Shop.auth.layout', ['title' => __('boilerplate::auth.password.title'), 'bodyClass' => 'hold-transition login-page']) - -@section('content') - - - @if (session('status')) -
- {{ session('status') }} -
- @endif - - @include('Shop.auth.partials.lost_password') -@endsection diff --git a/resources/views/Shop/auth/register.blade.php b/resources/views/Shop/auth/register.blade.php deleted file mode 100644 index af1ea2b2..00000000 --- a/resources/views/Shop/auth/register.blade.php +++ /dev/null @@ -1,8 +0,0 @@ -@extends('Shop.layout.layout', [ - 'title' => __('home.title'), - 'bodyClass' => 'hold-transition login-page' -]) - -@section('content') - @include('Shop.auth.partials.register') -@endsection diff --git a/resources/views/Shop/layout/partials/header-profile.blade.php b/resources/views/Shop/layout/partials/header-profile.blade.php index 1ea7976a..06ef79fb 100644 --- a/resources/views/Shop/layout/partials/header-profile.blade.php +++ b/resources/views/Shop/layout/partials/header-profile.blade.php @@ -20,19 +20,19 @@ Déconnexion - @else diff --git a/resources/views/auth/layout.blade.php b/resources/views/auth/layout.blade.php index 89fcf408..614e587c 100644 --- a/resources/views/auth/layout.blade.php +++ b/resources/views/auth/layout.blade.php @@ -11,6 +11,13 @@ @stack('css') + +
+
+ +
+
+ @yield('content') @stack('js') diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 2824af46..38d31cda 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -1,14 +1,14 @@ -@extends('auth.layout', [ +@extends('Shop.auth.layout', [ 'title' => __('boilerplate::auth.login.title'), 'bodyClass' => 'hold-transition login-page' ]) @section('content') -
-
- -
-
@include('auth.partials.login') + +

+ Vous n'avez pas encore de compte ? + {{ __('Inscrivez-vous') }} +

@endsection diff --git a/resources/views/auth/partials/login.blade.php b/resources/views/auth/partials/login.blade.php index 0d255f62..4515e3fb 100644 --- a/resources/views/auth/partials/login.blade.php +++ b/resources/views/auth/partials/login.blade.php @@ -1,35 +1,42 @@ -{!! Form::open(['route' => 'boilerplate.login', 'method' => 'post', 'autocomplete'=> 'off']) !!} +{!! Form::open(['route' => 'login.post', 'method' => 'post', 'autocomplete'=> 'off']) !!}
-
+
{{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }} - +
+ +
{!! $errors->first('email','

:message

') !!}
-
+
{{ Form::password('password', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password')]) }} - +
+ +
{!! $errors->first('password','

:message

') !!}
-
+
+ +
+ +
{!! Form::close() !!} - -{{ __('boilerplate::auth.login.forgotpassword') }}
-@if(config('boilerplate.auth.register')) - {{ __('boilerplate::auth.login.register') }} -@endif diff --git a/resources/views/Shop/auth/partials/lost_password.blade.php b/resources/views/auth/partials/lost_password.blade.php similarity index 76% rename from resources/views/Shop/auth/partials/lost_password.blade.php rename to resources/views/auth/partials/lost_password.blade.php index edb32d0f..6a9f3b69 100644 --- a/resources/views/Shop/auth/partials/lost_password.blade.php +++ b/resources/views/auth/partials/lost_password.blade.php @@ -1,4 +1,4 @@ -{!! Form::open(['route' => 'Shop.password.email', 'method' => 'post', 'autocomplete'=> 'off']) !!} +{!! Form::open(['route' => 'password.email', 'method' => 'post', 'autocomplete'=> 'off']) !!}
{{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }} {!! $errors->first('email','

:message

') !!} @@ -13,4 +13,4 @@
{!! Form::close() !!} -{{ __('boilerplate::auth.password.login_link') }}
+{{ __('boilerplate::auth.password.login_link') }}
diff --git a/resources/views/Shop/auth/partials/register.blade.php b/resources/views/auth/partials/register.blade.php similarity index 98% rename from resources/views/Shop/auth/partials/register.blade.php rename to resources/views/auth/partials/register.blade.php index 720c43d5..ba472840 100644 --- a/resources/views/Shop/auth/partials/register.blade.php +++ b/resources/views/auth/partials/register.blade.php @@ -1,4 +1,4 @@ -{!! Form::open(['route' => 'Shop.register.post', 'method' => 'post', 'autocomplete'=> 'off']) !!} +{!! Form::open(['route' => 'register.post', 'method' => 'post', 'autocomplete'=> 'off']) !!}
@@ -59,7 +59,7 @@
- {{ Form::text('address2', old('address2'), ['class' => 'form-control', 'placeholder' => __('Complément d\'adresse'), 'required']) }} + {{ Form::text('address2', old('address2'), ['class' => 'form-control', 'placeholder' => __('Complément d\'adresse')]) }} {!! $errors->first('address2','

:message

') !!}
diff --git a/resources/views/auth/passwords/email.blade.php b/resources/views/auth/passwords/email.blade.php index 59f59270..6103e523 100644 --- a/resources/views/auth/passwords/email.blade.php +++ b/resources/views/auth/passwords/email.blade.php @@ -1,28 +1,13 @@ -@extends('boilerplate::auth.layout', ['title' => __('boilerplate::auth.password.title'), 'bodyClass' => 'hold-transition login-page']) +@extends('Shop.auth.layout', ['title' => __('boilerplate::auth.password.title'), 'bodyClass' => 'hold-transition login-page']) @section('content') - @component('boilerplate::auth.loginbox') - - @if (session('status')) -
- {{ session('status') }} -
- @endif - {!! Form::open(['route' => 'boilerplate.password.email', 'method' => 'post', 'autocomplete'=> 'off']) !!} -
- {{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }} - {!! $errors->first('email','

:message

') !!} -
-
-
-
- -
-
-
- {!! Form::close() !!} - {{ __('boilerplate::auth.password.login_link') }}
- @endcomponent + + + @if (session('status')) +
+ {{ session('status') }} +
+ @endif + + @include('Shop.auth.partials.lost_password') @endsection diff --git a/resources/views/auth/passwords/reset.blade.php b/resources/views/auth/passwords/reset.blade.php index 97fde9d7..a905c2c1 100644 --- a/resources/views/auth/passwords/reset.blade.php +++ b/resources/views/auth/passwords/reset.blade.php @@ -1,9 +1,12 @@ -@extends('boilerplate::auth.layout', ['title' => __('boilerplate::auth.password_reset.title')]) +@extends('Shop.auth.layout', [ + 'title' => __('boilerplate::auth.password_reset.title'), + 'bodyClass' => 'hold-transition login-page' +]) @section('content') @component('boilerplate::auth.loginbox') - {!! Form::open(['route' => 'Shop.password.reset.post', 'method' => 'post', 'autocomplete'=> 'off']) !!} + {!! Form::open(['route' => 'Shop.password.update', 'method' => 'post', 'autocomplete'=> 'off']) !!} {!! Form::hidden('token', $token) !!}
{{ Form::email('email', old('email', $email), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }} diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 86c3bc67..0606d302 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -1,39 +1,8 @@ -@extends('boilerplate::auth.layout', ['title' => __('boilerplate::auth.register.title'), 'bodyClass' => 'hold-transition login-page']) +@extends('Shop.layout.layout', [ + 'title' => __('home.title'), + 'bodyClass' => 'hold-transition login-page' +]) @section('content') - @component('boilerplate::auth.loginbox') - - {!! Form::open(['route' => 'boilerplate.register', 'method' => 'post', 'autocomplete'=> 'off']) !!} -
- {{ Form::text('first_name', old('first_name'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.first_name'), 'required', 'autofocus']) }} - {!! $errors->first('first_name','

:message

') !!} -
-
- {{ Form::text('last_name', old('last_name'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.last_name'), 'required']) }} - {!! $errors->first('last_name','

:message

') !!} -
-
- {{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required']) }} - {!! $errors->first('email','

:message

') !!} -
-
- {{ Form::password('password', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password'), 'required']) }} - {!! $errors->first('password','

:message

') !!} -
-
- {{ Form::password('password_confirmation', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password_confirm'), 'required']) }} - {!! $errors->first('password_confirmation','

:message

') !!} -
-
-
- -
-
- {!! Form::close() !!} - @if(!$firstUser) - {{ __('boilerplate::auth.register.login_link') }}
- @endif - @endcomponent + @include('auth.partials.register') @endsection diff --git a/resources/views/components/form/button.blade.php b/resources/views/components/form/button.blade.php index 0802083d..20a6ae24 100644 --- a/resources/views/components/form/button.blade.php +++ b/resources/views/components/form/button.blade.php @@ -1,8 +1,18 @@ \ No newline at end of file + diff --git a/resources/views/paybox/aborted.blade.php b/resources/views/paybox/aborted.blade.php new file mode 100644 index 00000000..982da525 --- /dev/null +++ b/resources/views/paybox/aborted.blade.php @@ -0,0 +1,9 @@ + + + + + + +You canceled the payment. + + \ No newline at end of file diff --git a/resources/views/paybox/accepted.blade.php b/resources/views/paybox/accepted.blade.php new file mode 100644 index 00000000..de9d9a21 --- /dev/null +++ b/resources/views/paybox/accepted.blade.php @@ -0,0 +1,9 @@ + + + + + + +Thank you for your payment. Your payment should be accepted soon. + + \ No newline at end of file diff --git a/resources/views/paybox/refused.blade.php b/resources/views/paybox/refused.blade.php new file mode 100644 index 00000000..3d07cd1a --- /dev/null +++ b/resources/views/paybox/refused.blade.php @@ -0,0 +1,9 @@ + + + + + + +It seems your payment has been refused. + + \ No newline at end of file diff --git a/resources/views/paybox/send.blade.php b/resources/views/paybox/send.blade.php new file mode 100644 index 00000000..93cf11a4 --- /dev/null +++ b/resources/views/paybox/send.blade.php @@ -0,0 +1,19 @@ + + + + + Send Paybox payment + + +
+ @foreach ($parameters as $name => $value) + + @endforeach + + +
+ + + diff --git a/resources/views/paybox/waiting.blade.php b/resources/views/paybox/waiting.blade.php new file mode 100644 index 00000000..bb84b4ec --- /dev/null +++ b/resources/views/paybox/waiting.blade.php @@ -0,0 +1,9 @@ + + + + + + +Your payment is waiting. It might take some time until it is completed. + + \ No newline at end of file diff --git a/resources/views/vendor/boilerplate/auth/layout.blade.php b/resources/views/vendor/boilerplate/auth/layout.blade.php index 79382968..09288f5b 100644 --- a/resources/views/vendor/boilerplate/auth/layout.blade.php +++ b/resources/views/vendor/boilerplate/auth/layout.blade.php @@ -20,6 +20,7 @@ + @stack('js') \ No newline at end of file diff --git a/resources/views/vendor/boilerplate/auth/login.blade.php b/resources/views/vendor/boilerplate/auth/login.blade.php index 3934b991..b1c22085 100644 --- a/resources/views/vendor/boilerplate/auth/login.blade.php +++ b/resources/views/vendor/boilerplate/auth/login.blade.php @@ -28,14 +28,16 @@ @if(config('boilerplate.locale.switch', false)) @endif
@endcomponent -@endsection +@endsection \ No newline at end of file diff --git a/resources/views/vendor/boilerplate/components/input.blade.php b/resources/views/vendor/boilerplate/components/input.blade.php index 8392be65..d66077d5 100644 --- a/resources/views/vendor/boilerplate/components/input.blade.php +++ b/resources/views/vendor/boilerplate/components/input.blade.php @@ -21,13 +21,20 @@
@endif @if($type === 'password') - {!! Form::password($name, array_merge(['class' => 'form-control'.$errors->first($name,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!} + {!! Form::password($name, array_merge(['class' => 'form-control'.$errors->first($nameDot,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!} @elseif($type === 'file') - {!! Form::file($name, array_merge(['class' => 'form-control-file'.$errors->first($name,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!} + {!! Form::file($name, array_merge(['class' => 'form-control-file'.$errors->first($nameDot,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!} @elseif($type === 'select') - {!! Form::select($name, $options ?? [], old($name, $value ?? ''), array_merge(['class' => 'form-control'.$errors->first($name,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!} + {!! Form::select($name, $options ?? [], old($name, $value ?? ''), array_merge(['class' => 'form-control'.$errors->first($nameDot,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!} @else - {!! Form::{$type ?? 'text'}($name, old($name, $value ?? ''), array_merge(['class' => 'form-control'.$errors->first($name,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!} +@if($clearable ?? false) +
+ +@endif + {!! Form::{$type ?? 'text'}($name, old($name, $value ?? ''), array_merge(['class' => 'form-control'.$errors->first($nameDot,' is-invalid').(isset($class) ? ' '.$class : '')], $attributes)) !!} +@if($clearable ?? false) +
+@endif @endif @if($append || $appendText)
@@ -44,7 +51,7 @@ @if($help ?? false) @lang($help) @endif -@error($name) +@error($nameDot)
{{ $message }}
@enderror
diff --git a/resources/views/vendor/boilerplate/components/select2.blade.php b/resources/views/vendor/boilerplate/components/select2.blade.php index bdf3e792..eb789047 100644 --- a/resources/views/vendor/boilerplate/components/select2.blade.php +++ b/resources/views/vendor/boilerplate/components/select2.blade.php @@ -5,7 +5,7 @@ @isset($label) @endisset - @if(!isset($multiple)) @endif @@ -20,7 +20,7 @@ @if($help ?? false) @lang($help) @endif -@error($name) +@error($nameDot)
{{ $message }}
@enderror
@@ -28,21 +28,36 @@ @component('boilerplate::minify') - +@endcomponent @slot('footer')
component / diff --git a/resources/views/vendor/boilerplate/plugins/demo/icheck.blade.php b/resources/views/vendor/boilerplate/plugins/demo/icheck.blade.php index c92a82bc..4bee603d 100644 --- a/resources/views/vendor/boilerplate/plugins/demo/icheck.blade.php +++ b/resources/views/vendor/boilerplate/plugins/demo/icheck.blade.php @@ -7,38 +7,38 @@
- - - + @component('boilerplate::icheck', ['name' => 'c1', 'label' => '', 'class' => 'mb-0', 'checked' => true])@endcomponent + @component('boilerplate::icheck', ['name' => 'c1', 'label' => '', 'class' => 'mb-0'])@endcomponent + @component('boilerplate::icheck', ['name' => 'c1', 'label' => 'Primary checkbox', 'class' => 'mb-0', 'disabled' => true])@endcomponent
- - - + @component('boilerplate::icheck', ['name' => 'r1', 'type' => 'radio', 'label' => '', 'class' => 'mb-0', 'checked' => true])@endcomponent + @component('boilerplate::icheck', ['name' => 'r1', 'type' => 'radio', 'label' => '', 'class' => 'mb-0'])@endcomponent + @component('boilerplate::icheck', ['name' => 'r1', 'type' => 'radio', 'label' => 'Primary checkbox', 'class' => 'mb-0', 'disabled' => true])@endcomponent
- - - + @component('boilerplate::icheck', ['name' => 'c2', 'color' => 'danger', 'label' => '', 'class' => 'mb-0', 'checked' => true])@endcomponent + @component('boilerplate::icheck', ['name' => 'c2', 'color' => 'danger', 'label' => '', 'class' => 'mb-0'])@endcomponent + @component('boilerplate::icheck', ['name' => 'c2', 'color' => 'danger', 'label' => 'Primary checkbox', 'class' => 'mb-0', 'disabled' => true])@endcomponent
- - - + @component('boilerplate::icheck', ['name' => 'r2', 'color' => 'danger', 'type' => 'radio', 'label' => '', 'class' => 'mb-0', 'checked' => true])@endcomponent + @component('boilerplate::icheck', ['name' => 'r2', 'color' => 'danger', 'type' => 'radio', 'label' => '', 'class' => 'mb-0'])@endcomponent + @component('boilerplate::icheck', ['name' => 'r2', 'color' => 'danger', 'type' => 'radio', 'label' => 'Primary checkbox', 'class' => 'mb-0', 'disabled' => true])@endcomponent
- - - + @component('boilerplate::icheck', ['name' => 'c3', 'color' => 'success', 'label' => '', 'class' => 'mb-0', 'checked' => true])@endcomponent + @component('boilerplate::icheck', ['name' => 'c3', 'color' => 'success', 'label' => '', 'class' => 'mb-0'])@endcomponent + @component('boilerplate::icheck', ['name' => 'c3', 'color' => 'success', 'label' => 'Primary checkbox', 'class' => 'mb-0', 'disabled' => true])@endcomponent
- - - + @component('boilerplate::icheck', ['name' => 'r3', 'color' => 'success', 'type' => 'radio', 'label' => '', 'class' => 'mb-0', 'checked' => true])@endcomponent + @component('boilerplate::icheck', ['name' => 'r3', 'color' => 'success', 'type' => 'radio', 'label' => '', 'class' => 'mb-0'])@endcomponent + @component('boilerplate::icheck', ['name' => 'r3', 'color' => 'success', 'type' => 'radio', 'label' => 'Primary checkbox', 'class' => 'mb-0', 'disabled' => true])@endcomponent
diff --git a/resources/views/vendor/boilerplate/roles/list.blade.php b/resources/views/vendor/boilerplate/roles/list.blade.php index 54655a34..3dc9cd10 100644 --- a/resources/views/vendor/boilerplate/roles/list.blade.php +++ b/resources/views/vendor/boilerplate/roles/list.blade.php @@ -13,6 +13,6 @@
@component('boilerplate::card') - + @component('boilerplate::datatable', ['name' => 'roles']) @endcomponent @endcomponent @endsection diff --git a/resources/views/vendor/boilerplate/users/list.blade.php b/resources/views/vendor/boilerplate/users/list.blade.php index da9e7b2a..e010dd69 100644 --- a/resources/views/vendor/boilerplate/users/list.blade.php +++ b/resources/views/vendor/boilerplate/users/list.blade.php @@ -17,7 +17,7 @@
@component('boilerplate::card') - + @component('boilerplate::datatable', ['name' => 'users']) @endcomponent @endcomponent @endsection diff --git a/routes/Admin/Shop/Orders.php b/routes/Admin/Shop/Orders.php index 380142c2..4cce24f6 100644 --- a/routes/Admin/Shop/Orders.php +++ b/routes/Admin/Shop/Orders.php @@ -1,12 +1,11 @@ name('Orders.')->group(function () { - Route::get('', 'OrderController@index')->name('index'); - Route::get('create', 'OrderController@create')->name('create'); - Route::delete('destroy', 'OrderController@destroy')->name('destroy'); - Route::post('update', 'OrderController@update')->name('update'); - Route::post('store', 'OrderController@store')->name('store'); - Route::get('edit/{id}', 'OrderController@edit')->name('edit'); - + Route::get('', 'OrderController@index')->name('index'); + Route::get('create', 'OrderController@create')->name('create'); + Route::delete('destroy', 'OrderController@destroy')->name('destroy'); + Route::post('update', 'OrderController@update')->name('update'); + Route::post('store', 'OrderController@store')->name('store'); + Route::get('edit/{id}', 'OrderController@edit')->name('edit'); }); diff --git a/routes/Admin/Shop/route.php b/routes/Admin/Shop/route.php index b1e0e830..25c290e3 100644 --- a/routes/Admin/Shop/route.php +++ b/routes/Admin/Shop/route.php @@ -12,7 +12,6 @@ Route::middleware('auth')->prefix('Shop')->namespace('Shop')->name('Shop.')->gro include __DIR__ . '/Invoices.php'; include __DIR__ . '/Merchandises.php'; include __DIR__ . '/Offers.php'; - include __DIR__ . '/OrderPayments.php'; include __DIR__ . '/Orders.php'; include __DIR__ . '/Packages.php'; include __DIR__ . '/PriceLists.php'; diff --git a/routes/Shop/Baskets.php b/routes/Shop/Baskets.php index ba12d07b..290547b6 100644 --- a/routes/Shop/Baskets.php +++ b/routes/Shop/Baskets.php @@ -1,6 +1,6 @@ name('Basket.')->group(function () { +Route::prefix('Panier')->name('Basket.')->group(function () { Route::post('getPrice', 'BasketController@getPrice')->name('getPrice'); Route::post('addBasket', 'BasketController@addBasket')->name('addBasket'); Route::get('modalBasket/{offer_id?}/{quantity?}', 'BasketController@modalBasket')->name('modalBasket'); diff --git a/routes/Shop/Categories.php b/routes/Shop/Categories.php index 9f420ac9..cb97eff6 100644 --- a/routes/Shop/Categories.php +++ b/routes/Shop/Categories.php @@ -1,6 +1,6 @@ name('Categories.')->group(function () { +Route::prefix('Rayons')->name('Categories.')->group(function () { Route::get('', 'CategoryController@index')->name('index'); Route::any('show/{id}', 'CategoryController@show')->name('show'); Route::get('getTree', 'CategoryController@getTree')->name('getTree'); diff --git a/routes/Shop/Customers.php b/routes/Shop/Customers.php index b694ed02..3675d70d 100644 --- a/routes/Shop/Customers.php +++ b/routes/Shop/Customers.php @@ -1,6 +1,6 @@ name('Customers.')->group(function () { +Route::prefix('Clients')->name('Customers.')->group(function () { Route::get('show/{id}', 'CustomerController@show')->name('show'); Route::get('profile/{id?}', 'CustomerController@profile')->name('profile'); }); diff --git a/routes/Shop/Invoices.php b/routes/Shop/Invoices.php index b26985d2..24dcfdaa 100644 --- a/routes/Shop/Invoices.php +++ b/routes/Shop/Invoices.php @@ -1,6 +1,6 @@ name('Invoices.')->group(function () { +Route::prefix('Factures')->name('Invoices.')->group(function () { Route::get('show/{id}', 'InvoiceController@show')->name('show'); }); diff --git a/routes/Shop/Offers.php b/routes/Shop/Offers.php index 4800bee2..1eb44671 100644 --- a/routes/Shop/Offers.php +++ b/routes/Shop/Offers.php @@ -1,6 +1,6 @@ name('Offers.')->group(function () { +Route::prefix('Offres')->name('Offers.')->group(function () { Route::get('show/{id}', 'OfferController@show')->name('show'); }); diff --git a/routes/Admin/Shop/OrderPayments.php b/routes/Shop/OrderPayments.php similarity index 100% rename from routes/Admin/Shop/OrderPayments.php rename to routes/Shop/OrderPayments.php diff --git a/routes/Shop/Searches.php b/routes/Shop/Searches.php index fe9e1e03..75a91403 100644 --- a/routes/Shop/Searches.php +++ b/routes/Shop/Searches.php @@ -1,6 +1,6 @@ prefix('Searches')->name('Searches.')->group(function () { - Route::get('results/{search?}', 'SearchController@search')->name('search'); +Route::prefix('Recherche')->name('Searches.')->group(function () { + Route::get('resultats/{search?}', 'SearchController@search')->name('search'); }); diff --git a/routes/Shop/route.php b/routes/Shop/route.php index c5e8281b..21476733 100644 --- a/routes/Shop/route.php +++ b/routes/Shop/route.php @@ -1,19 +1,6 @@ namespace('Shop')->name('Shop.')->group(function () { - Route::get('login', 'Auth\LoginController@showLoginForm')->name('login'); - Route::post('login', 'Auth\LoginController@login')->name('login.post'); - Route::post('logout', 'Auth\LoginController@logout')->name('logout'); - Route::get('invite/{token?}/{event_id?}', 'Auth\LoginController@invite')->name('invite'); - Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email'); - Route::get('password/request', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request'); - Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update'); - Route::get('password/reset/{token?}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset'); - Route::get('register', 'Auth\RegisterController@showRegistrationForm')->name('register'); - Route::post('register', 'Auth\RegisterController@register')->name('register.post'); -}); - -Route::prefix('Shop')->namespace('Shop')->name('Shop.')->group(function () { +Route::prefix('')->namespace('Shop')->name('Shop.')->group(function () { include __DIR__ . '/Articles.php'; include __DIR__ . '/Baskets.php'; include __DIR__ . '/Categories.php'; @@ -22,5 +9,6 @@ Route::prefix('Shop')->namespace('Shop')->name('Shop.')->group(function () { include __DIR__ . '/Offers.php'; include __DIR__ . '/Orders.php'; include __DIR__ . '/Orders.php'; + include __DIR__ . '/OrderPayments.php'; include __DIR__ . '/Searches.php'; }); diff --git a/routes/paybox.php b/routes/paybox.php new file mode 100644 index 00000000..980347ee --- /dev/null +++ b/routes/paybox.php @@ -0,0 +1,10 @@ +name('paybox.')->group(function () { + Route::get('accepted', 'Shop\PayboxController@accepted')->name('accepted'); + Route::get('refused', 'Shop\PayboxController@refused')->name('refused'); + Route::get('aborted', 'Shop\PayboxController@aborted')->name('aborted'); + Route::get('waiting', 'Shop\PayboxController@waiting')->name('waiting'); + Route::get('process', 'Shop\PayboxController@process')->name('process'); +}); + diff --git a/routes/web.php b/routes/web.php index 2bf370c9..05663fba 100644 --- a/routes/web.php +++ b/routes/web.php @@ -11,11 +11,25 @@ | */ -Auth::routes(); +// Auth::routes(); + +Route::prefix('')->namespace('')->name('')->group(function () { + Route::get('login', 'Auth\LoginController@showLoginForm')->name('login'); + Route::post('login', 'Auth\LoginController@login')->name('login.post'); + Route::post('logout', 'Auth\LoginController@logout')->name('logout'); + Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email'); + Route::get('password/request', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request'); + Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update'); + Route::get('password/reset/{token?}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset'); + Route::get('register', 'Auth\RegisterController@showRegistrationForm')->name('register'); + Route::post('register', 'Auth\RegisterController@register')->name('register.post'); +}); + Route::get('', 'Shop\HomeController@index')->name('welcome'); Route::get('home', 'Shop\HomeController@index')->name('home'); -include( __DIR__ . '/Admin/route.php'); -include( __DIR__ . '/Shop/route.php'); -include( __DIR__ . '/Botanic/route.php'); +include __DIR__ . '/Admin/route.php'; +include __DIR__ . '/Shop/route.php'; +include __DIR__ . '/Botanic/route.php'; +include __DIR__ . '/paybox.php';