diff --git a/config/app.php b/config/app.php index 1aff706f6..ea88f140c 100755 --- a/config/app.php +++ b/config/app.php @@ -297,6 +297,11 @@ return [ 'aliases' => [ + /** + * Laravel + * + * Place your aliases in alphabetical order. + */ 'App' => Illuminate\Support\Facades\App::class, 'Artisan' => Illuminate\Support\Facades\Artisan::class, 'Auth' => Illuminate\Support\Facades\Auth::class, @@ -330,18 +335,25 @@ return [ 'URL' => Illuminate\Support\Facades\URL::class, 'Validator' => Illuminate\Support\Facades\Validator::class, 'View' => Illuminate\Support\Facades\View::class, - 'Datagrid' => Webkul\Ui\DataGrid\Facades\DataGrid::class, - 'ProductGrid' => Webkul\Ui\DataGrid\Facades\ProductGrid::class, - 'Image' => Intervention\Image\Facades\Image::class, + + /** + * Bagisto + * + * Place your aliases in alphabetical order. + */ + 'Captcha' => Webkul\Customer\Facades\Captcha::class, 'Cart' => Webkul\Checkout\Facades\Cart::class, - 'Core' => Webkul\Core\Facades\Core::class, - 'DbView' => Flynsarmy\DbBladeCompiler\Facades\DbView::class, - 'PDF' => Barryvdh\DomPDF\Facade::class, - 'Excel' => Maatwebsite\Excel\Facades\Excel::class, 'Concord' => Konekt\Concord\Facades\Concord::class, - 'Helper' => Konekt\Concord\Facades\Helper::class, + 'Core' => Webkul\Core\Facades\Core::class, + 'Datagrid' => Webkul\Ui\DataGrid\Facades\DataGrid::class, + 'DbView' => Flynsarmy\DbBladeCompiler\Facades\DbView::class, 'Debugbar' => Barryvdh\Debugbar\Facade::class, + 'Excel' => Maatwebsite\Excel\Facades\Excel::class, + 'Helper' => Konekt\Concord\Facades\Helper::class, + 'Image' => Intervention\Image\Facades\Image::class, + 'PDF' => Barryvdh\DomPDF\Facade::class, 'ProductImage' => Webkul\Product\Facades\ProductImage::class, - 'ProductVideo' => Webkul\Product\Facades\ProductVideo::class + 'ProductGrid' => Webkul\Ui\DataGrid\Facades\ProductGrid::class, + 'ProductVideo' => Webkul\Product\Facades\ProductVideo::class, ], ]; diff --git a/packages/Webkul/API/Http/Controllers/Shop/CustomerController.php b/packages/Webkul/API/Http/Controllers/Shop/CustomerController.php index 7fb6b796b..fce2b50b8 100644 --- a/packages/Webkul/API/Http/Controllers/Shop/CustomerController.php +++ b/packages/Webkul/API/Http/Controllers/Shop/CustomerController.php @@ -2,11 +2,11 @@ namespace Webkul\API\Http\Controllers\Shop; -use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Event; -use Webkul\Customer\Repositories\CustomerRepository; +use Webkul\Customer\Http\Requests\CustomerRegistrationRequest; use Webkul\Customer\Repositories\CustomerGroupRepository; +use Webkul\Customer\Repositories\CustomerRepository; class CustomerController extends Controller { @@ -70,14 +70,9 @@ class CustomerController extends Controller * * @return \Illuminate\Http\Response */ - public function create(Request $request) + public function create(CustomerRegistrationRequest $request) { - $this->validate($request, [ - 'first_name' => 'required', - 'last_name' => 'required', - 'email' => 'email|required|unique:customers,email', - 'password' => 'confirmed|min:6|required', - ]); + $request->validated(); $data = [ 'first_name' => $request->get('first_name'), diff --git a/packages/Webkul/API/Http/Controllers/Shop/ForgotPasswordController.php b/packages/Webkul/API/Http/Controllers/Shop/ForgotPasswordController.php index e12e0c885..c3e109618 100644 --- a/packages/Webkul/API/Http/Controllers/Shop/ForgotPasswordController.php +++ b/packages/Webkul/API/Http/Controllers/Shop/ForgotPasswordController.php @@ -4,33 +4,30 @@ namespace Webkul\API\Http\Controllers\Shop; use Illuminate\Foundation\Auth\SendsPasswordResetEmails; use Illuminate\Support\Facades\Password; +use Webkul\Customer\Http\Requests\CustomerForgotPasswordRequest; class ForgotPasswordController extends Controller { use SendsPasswordResetEmails; - + /** * Store a newly created resource in storage. * * @return \Illuminate\Http\Response */ - public function store() + public function store(CustomerForgotPasswordRequest $request) { - $this->validate(request(), [ - 'email' => 'required|email', - ]); + $request->validated(); - $response = $this->broker()->sendResetLink(request(['email'])); + $response = $this->broker()->sendResetLink($request->only(['email'])); - if ($response == Password::RESET_LINK_SENT) { - return response()->json([ + return $response == Password::RESET_LINK_SENT + ? response()->json([ 'message' => trans($response), + ]) + : response()->json([ + 'error' => trans($response), ]); - } - - return response()->json([ - 'error' => trans($response), - ]); } /** @@ -42,4 +39,4 @@ class ForgotPasswordController extends Controller { return Password::broker('customers'); } -} \ No newline at end of file +} diff --git a/packages/Webkul/API/Http/Controllers/Shop/SessionController.php b/packages/Webkul/API/Http/Controllers/Shop/SessionController.php index b84f3694d..5b6b4a45f 100644 --- a/packages/Webkul/API/Http/Controllers/Shop/SessionController.php +++ b/packages/Webkul/API/Http/Controllers/Shop/SessionController.php @@ -3,8 +3,9 @@ namespace Webkul\API\Http\Controllers\Shop; use Illuminate\Support\Facades\Event; -use Webkul\Customer\Repositories\CustomerRepository; use Webkul\API\Http\Resources\Customer\Customer as CustomerResource; +use Webkul\Customer\Http\Requests\CustomerLoginRequest; +use Webkul\Customer\Repositories\CustomerRepository; class SessionController extends Controller { @@ -45,22 +46,19 @@ class SessionController extends Controller * * @return \Illuminate\Http\Response */ - public function create() + public function create(CustomerLoginRequest $request) { - request()->validate([ - 'email' => 'required|email', - 'password' => 'required', - ]); + $request->validated(); $jwtToken = null; - if (! $jwtToken = auth()->guard($this->guard)->attempt(request()->only('email', 'password'))) { + if (! $jwtToken = auth()->guard($this->guard)->attempt($request->only(['email', 'password']))) { return response()->json([ 'error' => 'Invalid Email or Password', ], 401); } - Event::dispatch('customer.after.login', request('email')); + Event::dispatch('customer.after.login', $request->get('email')); $customer = auth($this->guard)->user(); diff --git a/packages/Webkul/Customer/src/Captcha.php b/packages/Webkul/Customer/src/Captcha.php new file mode 100644 index 000000000..c061c9658 --- /dev/null +++ b/packages/Webkul/Customer/src/Captcha.php @@ -0,0 +1,212 @@ +siteKey = $this->getSiteKey(); + + $this->secretKey = $this->getSecretKey(); + } + + /** + * Check whether captcha is active or not. + * + * @return bool + */ + public function isActive(): bool + { + return (bool) core()->getConfigData('customer.captcha.credentials.status'); + } + + /** + * Get site key from the core config. + * + * @return null|string + */ + public function getSiteKey(): ?string + { + return core()->getConfigData('customer.captcha.credentials.site_key'); + } + + /** + * Get secret key from the core config. + * + * @return null|string + */ + public function getSecretKey(): ?string + { + return core()->getConfigData('customer.captcha.credentials.secret_key'); + } + + /** + * Get client endpoint. + * + * @return string + */ + public function getClientEndpoint(): string + { + return static::CLIENT_ENDPOINT; + } + + /** + * Get site verify endpoint. + * + * @return string + */ + public function getSiteVerifyEndpoint(): string + { + return static::SITE_VERIFY_ENDPOINT; + } + + /** + * Render JS. + * + * @return string + */ + public function renderJS(): string + { + return $this->isActive() + ? $this->getCaptchaJSView() + : ''; + } + + /** + * Render Captcha. + * + * @return string + */ + public function render(): string + { + return $this->isActive() + ? $this->getCaptchaView() + : ''; + } + + /** + * Validate response. + * + * @return bool + */ + public function validateResponse($response): bool + { + $client = new \GuzzleHttp\Client(); + + $response = $client->post($this->getSiteVerifyEndpoint(), [ + 'query' => [ + 'secret' => $this->secretKey, + 'response' => $response + ] + ]); + + return json_decode($response->getBody())->success; + } + + /** + * Get or merge existing validations with your captcha validations. + * + * @return array + */ + public function getValidations($rules = []): array + { + return $this->isActive() + ? array_merge($rules, ['g-recaptcha-response' => 'required|captcha']) + : $rules; + } + + /** + * Get or merge existing validation messages with your captcha validation messages. + * + * @return array + */ + public function getValidationMessages($messages = []): array + { + return $this->isActive() + ? array_merge($messages, [ + 'g-recaptcha-response.required' => __('customer::app.admin.system.captcha.validations.required'), + 'g-recaptcha-response.captcha' => __('customer::app.admin.system.captcha.validations.captcha') + ]) + : $messages; + } + + /** + * Get attributes. + * + * @return array + */ + protected function getAttributes(): array + { + return [ + 'class' => 'g-recaptcha', + 'data-sitekey' => $this->siteKey, + ]; + } + + /** + * Build attributes. + * + * @param array $attributes + * @return string + */ + protected function buildHTMLAttributes(array $attributes): string + { + $htmlAttributes = []; + + foreach ($attributes as $key => $value) { + $htmlAttributes[] = "{$key}=\"{$value}\""; + } + + return count($htmlAttributes) + ? implode(' ', $htmlAttributes) + : ''; + } + + /** + * Get captcha view. + * + * @return string + */ + protected function getCaptchaView() + { + $htmlAttributes = $this->buildHTMLAttributes($this->getAttributes()); + + return view('customer::captcha.view', [ + 'htmlAttributes' => $htmlAttributes + ])->render(); + } + + /** + * Get captcha script view. + * + * @return string + */ + protected function getCaptchaJSView() + { + return view('customer::captcha.scripts', [ + 'clientEndPoint' => $this->getClientEndpoint() + ])->render(); + } +} diff --git a/packages/Webkul/Customer/src/Config/system.php b/packages/Webkul/Customer/src/Config/system.php new file mode 100644 index 000000000..b656be83e --- /dev/null +++ b/packages/Webkul/Customer/src/Config/system.php @@ -0,0 +1,31 @@ + 'customer.captcha', + 'name' => 'customer::app.admin.system.captcha.title', + 'sort' => 1, + ], [ + 'key' => 'customer.captcha.credentials', + 'name' => 'customer::app.admin.system.captcha.credentials', + 'sort' => 1, + 'fields' => [ + [ + 'name' => 'site_key', + 'title' => 'customer::app.admin.system.captcha.site-key', + 'type' => 'text', + 'channel_based' => true, + ], [ + 'name' => 'secret_key', + 'title' => 'customer::app.admin.system.captcha.secret-key', + 'type' => 'text', + 'channel_based' => true, + ], [ + 'name' => 'status', + 'title' => 'customer::app.admin.system.captcha.status', + 'type' => 'boolean', + 'channel_based' => true, + ] + ], + ], +]; diff --git a/packages/Webkul/Customer/src/Contracts/Captcha.php b/packages/Webkul/Customer/src/Contracts/Captcha.php new file mode 100644 index 000000000..e38f8243d --- /dev/null +++ b/packages/Webkul/Customer/src/Contracts/Captcha.php @@ -0,0 +1,10 @@ +validate(request(), [ - 'email' => 'required|email', - ]); + $request->validated(); - $response = $this->broker()->sendResetLink( - request(['email']) - ); + try { + $response = $this->broker()->sendResetLink($request->only(['email'])); if ($response == Password::RESET_LINK_SENT) { session()->flash('success', trans('customer::app.forget_password.reset_link_sent')); @@ -59,7 +56,7 @@ class ForgotPasswordController extends Controller } return back() - ->withInput(request(['email'])) + ->withInput($request->only(['email'])) ->withErrors([ 'email' => trans('customer::app.forget_password.email_not_exist'), ]); @@ -69,6 +66,7 @@ class ForgotPasswordController extends Controller return redirect()->back(); } catch (\Exception $e) { report($e); + session()->flash('error', trans($e->getMessage())); return redirect()->back(); @@ -84,4 +82,4 @@ class ForgotPasswordController extends Controller { return Password::broker('customers'); } -} \ No newline at end of file +} diff --git a/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php b/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php index a3b14395f..1cdd3cb8e 100755 --- a/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php +++ b/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php @@ -2,54 +2,54 @@ namespace Webkul\Customer\Http\Controllers; -use Illuminate\Support\Str; +use Cookie; use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Mail; +use Illuminate\Support\Str; +use Webkul\Core\Repositories\SubscribersListRepository; +use Webkul\Customer\Http\Requests\CustomerRegistrationRequest; use Webkul\Customer\Mail\RegistrationEmail; use Webkul\Customer\Mail\VerificationEmail; -use Webkul\Shop\Mail\SubscriptionEmail; -use Webkul\Customer\Repositories\CustomerRepository; use Webkul\Customer\Repositories\CustomerGroupRepository; -use Webkul\Core\Repositories\SubscribersListRepository; -use Cookie; +use Webkul\Customer\Repositories\CustomerRepository; +use Webkul\Shop\Mail\SubscriptionEmail; class RegistrationController extends Controller { /** - * Contains route related configuration + * Contains route related configuration. * * @var array */ protected $_config; /** - * CustomerRepository object + * Customer repository instance. * * @var \Webkul\Customer\Repositories\CustomerRepository */ protected $customerRepository; /** - * CustomerGroupRepository object + * Customer group repository instance. * * @var \Webkul\Customer\Repositories\CustomerGroupRepository */ protected $customerGroupRepository; /** - * SubscribersListRepository + * Subscribers list repository instance. * * @var \Webkul\Core\Repositories\SubscribersListRepository */ protected $subscriptionRepository; /** - * Create a new Repository instance. + * Create a new controller instance. * * @param \Webkul\Customer\Repositories\CustomerRepository $customer * @param \Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository * @param \Webkul\Core\Repositories\SubscribersListRepository $subscriptionRepository - * * @return void */ public function __construct( @@ -80,16 +80,12 @@ class RegistrationController extends Controller /** * Method to store user's sign up form data to DB. * + * @param \Webkul\Customer\Http\Requests\CustomerRegistrationRequest $request * @return \Illuminate\Http\Response */ - public function create() + public function create(CustomerRegistrationRequest $request) { - $this->validate(request(), [ - 'first_name' => 'string|required', - 'last_name' => 'string|required', - 'email' => 'email|required|unique:customers,email', - 'password' => 'confirmed|min:6|required', - ]); + $request->validated(); $data = array_merge(request()->input(), [ 'password' => bcrypt(request()->input('password')), @@ -169,7 +165,7 @@ class RegistrationController extends Controller } /** - * Method to verify account + * Method to verify account. * * @param string $token * @return \Illuminate\Http\Response @@ -190,6 +186,8 @@ class RegistrationController extends Controller } /** + * Resend verification email. + * * @param string $email * @return \Illuminate\Http\Response */ diff --git a/packages/Webkul/Customer/src/Http/Controllers/SessionController.php b/packages/Webkul/Customer/src/Http/Controllers/SessionController.php index a1ab9fe1e..60fbf9b78 100755 --- a/packages/Webkul/Customer/src/Http/Controllers/SessionController.php +++ b/packages/Webkul/Customer/src/Http/Controllers/SessionController.php @@ -2,26 +2,27 @@ namespace Webkul\Customer\Http\Controllers; -use Illuminate\Support\Facades\Event; use Cookie; +use Illuminate\Support\Facades\Event; +use Webkul\Customer\Http\Requests\CustomerLoginRequest; class SessionController extends Controller { /** - * Contains route related configuration + * Contains route related configuration. * * @var array */ protected $_config; /** - * Create a new Repository instance. + * Create a new controller instance. * * @return void - */ + */ public function __construct() { - $this->middleware('customer')->except(['show','create']); + $this->middleware('customer')->except(['show', 'create']); $this->_config = request('_config'); } @@ -33,26 +34,22 @@ class SessionController extends Controller */ public function show() { - if (auth()->guard('customer')->check()) { - return redirect()->route('customer.profile.index'); - } else { - return view($this->_config['view']); - } + return auth()->guard('customer')->check() + ? redirect()->route('customer.profile.index') + : view($this->_config['view']); } /** * Show the form for creating a new resource. * + * @param \Webkul\Customer\Http\Requests\CustomerLoginRequest $request * @return \Illuminate\Http\Response */ - public function create() + public function create(CustomerLoginRequest $request) { - $this->validate(request(), [ - 'email' => 'required|email', - 'password' => 'required', - ]); + $request->validated(); - if (! auth()->guard('customer')->attempt(request(['email', 'password']))) { + if (! auth()->guard('customer')->attempt($request->only(['email', 'password']))) { session()->flash('error', trans('shop::app.customer.login-form.invalid-creds')); return redirect()->back(); @@ -71,15 +68,17 @@ class SessionController extends Controller Cookie::queue(Cookie::make('enable-resend', 'true', 1)); - Cookie::queue(Cookie::make('email-for-resend', request('email'), 1)); + Cookie::queue(Cookie::make('email-for-resend', $request->get('email'), 1)); auth()->guard('customer')->logout(); return redirect()->back(); } - //Event passed to prepare cart after login - Event::dispatch('customer.after.login', request('email')); + /** + * Event passed to prepare cart after login. + */ + Event::dispatch('customer.after.login', $request->get('email')); return redirect()->intended(route($this->_config['redirect'])); } @@ -98,4 +97,4 @@ class SessionController extends Controller return redirect()->route($this->_config['redirect']); } -} \ No newline at end of file +} diff --git a/packages/Webkul/Customer/src/Http/Requests/CustomerForgotPasswordRequest.php b/packages/Webkul/Customer/src/Http/Requests/CustomerForgotPasswordRequest.php new file mode 100644 index 000000000..5dc1209df --- /dev/null +++ b/packages/Webkul/Customer/src/Http/Requests/CustomerForgotPasswordRequest.php @@ -0,0 +1,48 @@ + 'required|email', + ]; + + /** + * Determine if the user is authorized to make this request. + * + * @return bool + */ + public function authorize() + { + return true; + } + + /** + * Get the validation rules that apply to the request. + * + * @return array + */ + public function rules() + { + return Captcha::getValidations($this->rules); + } + + /** + * Get custom messages for validator errors. + * + * @return array + */ + public function messages() + { + return Captcha::getValidationMessages(); + } +} diff --git a/packages/Webkul/Customer/src/Http/Requests/CustomerLoginRequest.php b/packages/Webkul/Customer/src/Http/Requests/CustomerLoginRequest.php new file mode 100644 index 000000000..9e9854a63 --- /dev/null +++ b/packages/Webkul/Customer/src/Http/Requests/CustomerLoginRequest.php @@ -0,0 +1,49 @@ + 'required|email', + 'password' => 'required', + ]; + + /** + * Determine if the user is authorized to make this request. + * + * @return bool + */ + public function authorize() + { + return true; + } + + /** + * Get the validation rules that apply to the request. + * + * @return array + */ + public function rules() + { + return Captcha::getValidations($this->rules); + } + + /** + * Get custom messages for validator errors. + * + * @return array + */ + public function messages() + { + return Captcha::getValidationMessages(); + } +} diff --git a/packages/Webkul/Customer/src/Http/Requests/CustomerRegistrationRequest.php b/packages/Webkul/Customer/src/Http/Requests/CustomerRegistrationRequest.php new file mode 100644 index 000000000..dafe84390 --- /dev/null +++ b/packages/Webkul/Customer/src/Http/Requests/CustomerRegistrationRequest.php @@ -0,0 +1,51 @@ + 'string|required', + 'last_name' => 'string|required', + 'email' => 'email|required|unique:customers,email', + 'password' => 'confirmed|min:6|required', + ]; + + /** + * Determine if the user is authorized to make this request. + * + * @return bool + */ + public function authorize() + { + return true; + } + + /** + * Get the validation rules that apply to the request. + * + * @return array + */ + public function rules() + { + return Captcha::getValidations($this->rules); + } + + /** + * Get custom messages for validator errors. + * + * @return array + */ + public function messages() + { + return Captcha::getValidationMessages(); + } +} diff --git a/packages/Webkul/Customer/src/Providers/CustomerServiceProvider.php b/packages/Webkul/Customer/src/Providers/CustomerServiceProvider.php index f12f69d6e..a482df188 100755 --- a/packages/Webkul/Customer/src/Providers/CustomerServiceProvider.php +++ b/packages/Webkul/Customer/src/Providers/CustomerServiceProvider.php @@ -3,19 +3,31 @@ namespace Webkul\Customer\Providers; use Illuminate\Database\Eloquent\Factory as EloquentFactory; -use Illuminate\Support\ServiceProvider; use Illuminate\Routing\Router; +use Illuminate\Support\ServiceProvider; +use Webkul\Customer\Captcha; use Webkul\Customer\Http\Middleware\RedirectIfNotCustomer; class CustomerServiceProvider extends ServiceProvider { + /** + * Bootstrap application services. + * + * @return void + */ public function boot(Router $router) { $router->aliasMiddleware('customer', RedirectIfNotCustomer::class); + $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); + $this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'customer'); - $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); + $this->loadViewsFrom(__DIR__ . '/../Resources/views', 'customer'); + + $this->app['validator']->extend('captcha', function ($attribute, $value, $parameters) { + return $this->app['captcha']->validateResponse($value); + }); } /** @@ -26,14 +38,19 @@ class CustomerServiceProvider extends ServiceProvider */ public function register() { + $this->registerConfig(); + $this->registerEloquentFactoriesFrom(__DIR__ . '/../Database/Factories'); + + $this->app->singleton('captcha', function ($app) { + return new Captcha(); + }); } /** * Register factories. * - * @param string $path - * + * @param string $path * @return void * @throws \Illuminate\Contracts\Container\BindingResolutionException */ @@ -41,4 +58,17 @@ class CustomerServiceProvider extends ServiceProvider { $this->app->make(EloquentFactory::class)->load($path); } + + /** + * Register package config. + * + * @return void + */ + protected function registerConfig() + { + $this->mergeConfigFrom( + dirname(__DIR__) . '/Config/system.php', + 'core' + ); + } } diff --git a/packages/Webkul/Customer/src/Resources/lang/ar/app.php b/packages/Webkul/Customer/src/Resources/lang/ar/app.php index 8911aef0d..d083a78a2 100644 --- a/packages/Webkul/Customer/src/Resources/lang/ar/app.php +++ b/packages/Webkul/Customer/src/Resources/lang/ar/app.php @@ -11,7 +11,30 @@ return [ 'select-options' => 'تحتاج إلى تحديد خيارات قبل إضافة إلى قائمة الأمنيات', 'remove-all-success' => 'تمت إزالة جميع العناصر من قائمة الأمنيات الخاصة بك', ], + 'reviews' => [ - 'empty' => '.لم تقم بمراجعة أي منتج حتى الآن' - ] -]; \ No newline at end of file + 'empty' => '.لم تقم بمراجعة أي منتج حتى الآن', + ], + + 'forget_password' => [ + 'reset_link_sent' => 'لقد أرسلنا رابط إعادة تعيين كلمة المرور بالبريد الإلكتروني.', + 'email_not_exist' => "لا يمكننا العثور على مستخدم بعنوان البريد الإلكتروني هذا", + ], + + 'admin' => [ + 'system' => [ + 'captcha' => [ + 'title' => 'كلمة التحقق', + 'credentials' => 'أوراق اعتماد', + 'site-key' => 'مفتاح الموقع', + 'secret-key' => 'المفتاح السري', + 'status' => 'حالة', + + 'validations' => [ + 'required' => 'الرجاء اختيار CAPTCHA', + 'captcha' => 'هناك خطأ ما! حاول مرة اخرى.', + ] + ], + ], + ], +]; diff --git a/packages/Webkul/Customer/src/Resources/lang/de/app.php b/packages/Webkul/Customer/src/Resources/lang/de/app.php index 9c197a591..783124e4d 100755 --- a/packages/Webkul/Customer/src/Resources/lang/de/app.php +++ b/packages/Webkul/Customer/src/Resources/lang/de/app.php @@ -11,10 +11,30 @@ return [ 'select-options' => 'Vor dem Hinzufügen zur Wunschliste müssen Optionen ausgewählt werden', 'remove-all-success' => 'Alle Elemente von Ihrer Wunschliste wurden entfernt', ], + 'reviews' => [ - 'empty' => 'Sie haben noch kein Produkt bewertet' + 'empty' => 'Sie haben noch kein Produkt bewertet', ], + 'forget_password' => [ - 'reset_link_sent' => 'Wir haben Ihren Link zum Zurücksetzen des Passworts per E-Mail gesendet.' - ] -]; \ No newline at end of file + 'reset_link_sent' => 'Wir haben Ihren Link zum Zurücksetzen des Passworts per E-Mail gesendet.', + 'email_not_exist' => "Wir können keinen Benutzer mit dieser E-Mail-Adresse finden", + ], + + 'admin' => [ + 'system' => [ + 'captcha' => [ + 'title' => 'Captcha', + 'credentials' => 'Referenzen', + 'site-key' => 'Site-Schlüssel', + 'secret-key' => 'Geheimer Schlüssel', + 'status' => 'Status', + + 'validations' => [ + 'required' => 'Bitte wählen Sie CAPTCHA', + 'captcha' => 'Etwas ist schief gelaufen! Bitte versuche es erneut.', + ] + ], + ], + ], +]; diff --git a/packages/Webkul/Customer/src/Resources/lang/en/app.php b/packages/Webkul/Customer/src/Resources/lang/en/app.php index a229b6fbc..7108bc25c 100755 --- a/packages/Webkul/Customer/src/Resources/lang/en/app.php +++ b/packages/Webkul/Customer/src/Resources/lang/en/app.php @@ -11,11 +11,30 @@ return [ 'select-options' => 'Need To Select Options Before Adding To Wishlist', 'remove-all-success' => 'All The Items From Your Wishlist Have Been Removed', ], + 'reviews' => [ - 'empty' => 'You have not reviewed any of product yet' + 'empty' => 'You have not reviewed any of product yet', ], + 'forget_password' => [ 'reset_link_sent' => 'We have e-mailed your reset password link.', - 'email_not_exist' => "We can't find a user with that e-mail address" - ] -]; \ No newline at end of file + 'email_not_exist' => "We can't find a user with that e-mail address", + ], + + 'admin' => [ + 'system' => [ + 'captcha' => [ + 'title' => 'Captcha', + 'credentials' => 'Credentials', + 'site-key' => 'Site Key', + 'secret-key' => 'Secret Key', + 'status' => 'Status', + + 'validations' => [ + 'required' => 'Please select CAPTCHA', + 'captcha' => 'Something went wrong! Please try again.', + ] + ], + ], + ], +]; diff --git a/packages/Webkul/Customer/src/Resources/lang/es/app.php b/packages/Webkul/Customer/src/Resources/lang/es/app.php index 7ef9cac47..af560c4c4 100755 --- a/packages/Webkul/Customer/src/Resources/lang/es/app.php +++ b/packages/Webkul/Customer/src/Resources/lang/es/app.php @@ -11,11 +11,30 @@ return [ 'select-options' => 'Necesita seleccionar opciones antes de agregar a la lista de deseos', 'remove-all-success' => 'Se han eliminado todos los elementos de su lista de deseos', ], + 'reviews' => [ - 'empty' => 'Aún no has calificado ningún producto' + 'empty' => 'Aún no has calificado ningún producto', ], + 'forget_password' => [ 'reset_link_sent' => 'Hemos enviado un correo electrónico con el enlace para restablecer la contraseña.', - 'email_not_exist' => "No podemos encontrar un usuario con esa dirección de correo electrónico" - ] + 'email_not_exist' => "No podemos encontrar un usuario con esa dirección de correo electrónico", + ], + + 'admin' => [ + 'system' => [ + 'captcha' => [ + 'title' => 'Captcha', + 'credentials' => 'Cartas credenciales', + 'site-key' => 'Clave del sitio', + 'secret-key' => 'Llave secreta', + 'status' => 'Estado', + + 'validations' => [ + 'required' => 'Seleccione CAPTCHA', + 'captcha' => '¡Algo salió mal! Inténtalo de nuevo.', + ] + ], + ], + ], ]; diff --git a/packages/Webkul/Customer/src/Resources/lang/fr/app.php b/packages/Webkul/Customer/src/Resources/lang/fr/app.php new file mode 100755 index 000000000..5d4760cbf --- /dev/null +++ b/packages/Webkul/Customer/src/Resources/lang/fr/app.php @@ -0,0 +1,40 @@ + [ + 'success' => 'Article ajouté avec succès à la liste de souhaits', + 'failure' => 'L\'article ne peut pas être ajouté à la liste de souhaits', + 'already' => 'Article déjà présent dans votre liste de souhaits', + 'removed' => 'Article supprimé avec succès de la liste de souhaits', + 'remove-fail' => 'L\'article ne peut pas être supprimé de la liste de souhaits', + 'empty' => 'Vous n\'avez aucun article dans votre liste de souhaits', + 'select-options' => 'Besoin de sélectionner des options avant d\'ajouter à la liste de souhaits', + 'remove-all-success' => 'Tous les articles de votre liste de souhaits ont été supprimés', + ], + + 'reviews' => [ + 'empty' => 'Vous n\'avez pas encore évalué de produit', + ], + + 'forget_password' => [ + 'reset_link_sent' => 'Nous avons envoyé par e-mail votre lien de réinitialisation de mot de passe.', + 'email_not_exist' => 'Nous ne pouvons pas trouver un utilisateur avec cette adresse e-mail', + ], + + 'admin' => [ + 'system' => [ + 'captcha' => [ + 'title' => 'Captcha', + 'credentials' => 'Crédits', + 'site-key' => 'Clé du site', + 'secret-key' => 'Clef secrète', + 'status' => 'Statut', + + 'validations' => [ + 'required' => 'Veuillez sélectionner CAPTCHA', + 'captcha' => 'Quelque chose s\'est mal passé ! Veuillez réessayer.', + ] + ], + ], + ], +]; diff --git a/packages/Webkul/Customer/src/Resources/lang/it/app.php b/packages/Webkul/Customer/src/Resources/lang/it/app.php index de13bb197..fa7d02fa6 100644 --- a/packages/Webkul/Customer/src/Resources/lang/it/app.php +++ b/packages/Webkul/Customer/src/Resources/lang/it/app.php @@ -11,11 +11,30 @@ return [ 'select-options' => 'Seleziona una opzione del prodotto prima di aggiungerlo ai Preferiti', 'remove-all-success' => 'Tutti i Prodotti presenti nei preferiti sono stati rimossi', ], + 'reviews' => [ 'empty' => 'Non hai ancora recensito i nostri prodotti' ], - 'forget_password' => [ - 'reset_link_sent' => 'Ti abbiamo inviato una email per generare una nuova password.' - ] -]; \ No newline at end of file + 'forget_password' => [ + 'reset_link_sent' => 'Abbiamo inviato un\'e-mail con il link per reimpostare la password.', + 'email_not_exist' => "Non riusciamo a trovare un utente con quell'indirizzo e-mail", + ], + + 'admin' => [ + 'system' => [ + 'captcha' => [ + 'title' => 'Captcha', + 'credentials' => 'Credenziali', + 'site-key' => 'Chiave del sito', + 'secret-key' => 'Chiave segreta', + 'status' => 'Stato', + + 'validations' => [ + 'required' => 'Seleziona CAPTCHA', + 'captcha' => 'Qualcosa è andato storto! Per favore riprova.', + ] + ], + ], + ], +]; diff --git a/packages/Webkul/Customer/src/Resources/lang/nl/app.php b/packages/Webkul/Customer/src/Resources/lang/nl/app.php new file mode 100755 index 000000000..7d01b9b87 --- /dev/null +++ b/packages/Webkul/Customer/src/Resources/lang/nl/app.php @@ -0,0 +1,40 @@ + [ + 'success' => 'Artikel succesvol toegevoegd aan verlanglijst', + 'failure' => 'Artikel kan niet worden toegevoegd aan verlanglijst', + 'already' => 'Artikel al aanwezig in uw verlanglijst', + 'removed' => 'Artikel succesvol verwijderd van verlanglijst', + 'remove-fail' => 'Artikel kan niet van verlanglijst worden verwijderd', + 'empty' => 'U heeft geen items op uw verlanglijst', + 'select-options' => 'Moet opties selecteren voordat u aan verlanglijst toevoegt', + 'remove-all-success' => 'Alle items van je verlanglijst zijn verwijderd', + ], + + 'reviews' => [ + 'empty' => 'U heeft nog geen product beoordeeld', + ], + + 'forget_password' => [ + 'reset_link_sent' => 'We hebben de link voor het opnieuw instellen van uw wachtwoord per e-mail verzonden.', + 'email_not_exist' => "We kunnen geen gebruiker met dat e-mailadres vinden", + ], + + 'admin' => [ + 'system' => [ + 'captcha' => [ + 'title' => 'Captcha', + 'credentials' => 'Inloggegevens', + 'site-key' => 'Sitesleutel', + 'secret-key' => 'Geheime sleutel', + 'status' => 'Toestand', + + 'validations' => [ + 'required' => 'Selecteer CAPTCHA', + 'captcha' => 'Er is iets fout gegaan! Probeer het opnieuw.', + ] + ], + ], + ], +]; diff --git a/packages/Webkul/Customer/src/Resources/lang/pt_BR/app.php b/packages/Webkul/Customer/src/Resources/lang/pt_BR/app.php index 4f2263f77..580176677 100755 --- a/packages/Webkul/Customer/src/Resources/lang/pt_BR/app.php +++ b/packages/Webkul/Customer/src/Resources/lang/pt_BR/app.php @@ -11,7 +11,30 @@ return [ 'select-options' => 'Precisa selecionar opções antes de adicionar à lista de desejos', 'remove-all-success' => 'Todos os itens da sua lista de desejos foram removidos', ], + 'reviews' => [ - 'empty' => 'Você não avaliou nenhum produto ainda' - ] -]; \ No newline at end of file + 'empty' => 'Você não avaliou nenhum produto ainda', + ], + + 'forget_password' => [ + 'reset_link_sent' => 'Enviamos por e-mail o link de redefinição de senha.', + 'email_not_exist' => "Não conseguimos encontrar um usuário com esse endereço de e-mail", + ], + + 'admin' => [ + 'system' => [ + 'captcha' => [ + 'title' => 'Captcha', + 'credentials' => 'Credenciais', + 'site-key' => 'Chave do Site', + 'secret-key' => 'Chave secreta', + 'status' => 'Status', + + 'validations' => [ + 'required' => 'Selecione CAPTCHA', + 'captcha' => 'Algo deu errado! Por favor, tente novamente.', + ] + ], + ], + ], +]; diff --git a/packages/Webkul/Customer/src/Resources/views/captcha/scripts.blade.php b/packages/Webkul/Customer/src/Resources/views/captcha/scripts.blade.php new file mode 100644 index 000000000..e8f54e6ff --- /dev/null +++ b/packages/Webkul/Customer/src/Resources/views/captcha/scripts.blade.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/Webkul/Customer/src/Resources/views/captcha/view.blade.php b/packages/Webkul/Customer/src/Resources/views/captcha/view.blade.php new file mode 100644 index 000000000..be3d72df2 --- /dev/null +++ b/packages/Webkul/Customer/src/Resources/views/captcha/view.blade.php @@ -0,0 +1,7 @@ +
+ +@if ($errors->has('g-recaptcha-response')) + + {{ $errors->first('g-recaptcha-response') }} + +@endif \ No newline at end of file diff --git a/packages/Webkul/Customer/src/resources/manifest.php b/packages/Webkul/Customer/src/resources/manifest.php deleted file mode 100644 index c732276af..000000000 --- a/packages/Webkul/Customer/src/resources/manifest.php +++ /dev/null @@ -1,6 +0,0 @@ - 'Webkul Bagisto Customer', - 'version' => '0.0.1' - ]; diff --git a/packages/Webkul/Shop/src/Resources/views/customers/session/index.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/session/index.blade.php index 38bdbc9b1..8795b9616 100755 --- a/packages/Webkul/Shop/src/Resources/views/customers/session/index.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/customers/session/index.blade.php @@ -5,7 +5,6 @@ @endsection @section('content-wrapper') -