begin order form with registration

This commit is contained in:
Ludovic CANDELLIER
2022-06-26 23:33:39 +02:00
parent d50ecd674e
commit 8054bffb43
36 changed files with 442 additions and 423 deletions

View File

@@ -11,8 +11,7 @@ class HomepageController extends Controller
{
public function index(HomepagesDataTable $dataTable)
{
$data = [];
return $dataTable->render('Admin.Shop.Homepages.list', $data);
return $dataTable->render('Admin.Shop.Homepages.list', $data ?? []);
}
public function create()
@@ -33,7 +32,7 @@ class HomepageController extends Controller
public function edit($id)
{
$data['homepage'] = Homepages::edit($id);
$data['homepage'] = Homepages::get($id);
return view('Admin.Shop.Homepages.edit', $data);
}

View File

@@ -7,15 +7,7 @@ use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
use App\Repositories\Shop\Categories;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
public static function init()
{
$data['categories'] = Categories::getTreeVisibles();
return $data;
}
}

View File

@@ -12,7 +12,6 @@ class ArticleController extends Controller
public function show($id)
{
$data = self::init();
$data['article'] = Articles::getArticleToSell($id);
return view('Shop.Articles.show', $data);
}

View File

@@ -46,7 +46,6 @@ class RegisterController extends Controller
public function showRegistrationForm()
{
$data = self::init();
return view('Shop.auth.register', $data ?? []);
}
@@ -81,7 +80,6 @@ class RegisterController extends Controller
public function emailSendVerification(Request $request)
{
$request->user()->sendEmailVerificationNotification();
return back()->with('message', 'Verification link sent!');
}
}

View File

@@ -8,7 +8,7 @@ use App\Http\Controllers\Controller;
use App\Repositories\Core\User\ShopCart;
use App\Repositories\Shop\Offers;
use App\Repositories\Shop\Orders;
use App\Repositories\Users;
class BasketController extends Controller
{
@@ -37,10 +37,7 @@ class BasketController extends Controller
public function basket()
{
$data = self::init();
$data['basket'] = Offers::getBasket();
// dump($data['basket']);
// exit;
return view('Shop.Baskets.basket', $data);
}

View File

@@ -7,8 +7,6 @@ use App\Http\Controllers\Controller;
use App\Repositories\Shop\Articles;
use App\Repositories\Shop\Categories;
use App\Repositories\Shop\Offers;
use App\Repositories\Shop\Tags;
use App\Repositories\Shop\TagGroups;
use App\Datatables\Shop\CategoriesDataTable;
@@ -22,23 +20,19 @@ class CategoryController extends Controller
public function show(Request $request, $category_id)
{
$data = self::init();
$data['category'] = Categories::getFull($category_id);
$data['breadcrumb'] = Categories::getAncestorsByCategory($category_id);
$data['display_by_rows'] = $request->input('display_by_rows') ?? false;
$data['product_type'] = $request->input('product_type') ?? 'botanic';
$data['tags_selected'] = $request->input('tags') ?? [];
$data['articles'] = Articles::getArticlesToSell([
'category_id' => $category_id,
'tags' => $data['tags_selected'],
'product_type' => $data['product_type'],
]);
// dump($data['articles']);
// exit;
$data['tags'] = TagGroups::getWithTagsAndCountOffers($category_id);
// dump($data['tags']);
// exit;
$data = [
'category' => Categories::getFull($category_id),
'breadcrumb' => Categories::getAncestorsByCategory($category_id),
'display_by_rows' => $request->input('display_by_rows') ?? false,
'product_type' => $request->input('product_type') ?? 'botanic',
'tags_selected' => $request->input('tags') ?? [],
'articles' => Articles::getArticlesToSell([
'category_id' => $category_id,
'tags' => $request->input('tags') ?? [],
'product_type' => $request->input('product_type') ?? 'botanic',
]),
'tags' => TagGroups::getWithTagsAndCountOffers($category_id),
];
return view('Shop.Shelves.shelve', $data);
}

View File

@@ -6,8 +6,4 @@ use App\Http\Controllers\Controller as ParentController;
class Controller extends ParentController
{
public function __construct()
{
// $this->middleware('auth:guest');
}
}

View File

@@ -13,15 +13,13 @@ class HomeController extends Controller
{
public function index(Request $request)
{
$input = $request->input();
$data = self::init();
$data['display_by_rows'] = $input['by_rows'] ?? false;
$data['shelves'] = Articles::getArticlesByHomepage();
$data['text'] = Homepages::getHomepage();
// dump($data['shelves']);
// exit;
$data['tags'] = TagGroups::getWithTagsAndCountOffers();
$data['no_filter'] = true;
$data = [
'display_by_rows' => $request->input('by_rows') ?? false,
'shelves' => Articles::getArticlesByHomepage(),
'text' => Homepages::getHomepage(),
'tags' => TagGroups::getWithTagsAndCountOffers(),
'no_filter' => true,
];
return view('Shop.home', $data);
}
}

View File

@@ -5,83 +5,17 @@ namespace App\Http\Controllers\Shop;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Repositories\Core\User\ShopCart;
use App\Repositories\Shop\Orders;
use App\Repositories\Shop\Offers;
use App\Repositories\Shop\SaleChannels;
class OrderController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
public function order()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*
* @param \App\Order $order
* @return \Illuminate\Http\Response
*/
public function show(Order $order)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Order $order
* @return \Illuminate\Http\Response
*/
public function edit(Order $order)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Order $order
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Order $order)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param \App\Order $order
* @return \Illuminate\Http\Response
*/
public function destroy(Order $order)
{
//
$data['basket'] = ShopCart::getSummary();
$data['sale_channel'] = SaleChannels::getDefault();
return view('Shop.Orders.order', $data);
}
}

View File

@@ -11,11 +11,12 @@ class SearchController extends Controller
{
public function search(Request $request)
{
$data = self::init();
$data['articles'] = Searches::getResults($request->input());
$data['articles_count'] = $data['articles'] ? count($data['articles']) : 0;
$data['search'] = $request->input();
$data['product_type'] = $request->input('product_type');
$data = [
'articles'] => Searches::getResults($request->input()),
'articles_count' => $data['articles'] ? count($data['articles']) : 0,
'search' = $request->input(),
'product_type' => $request->input('product_type'),
];
return view('Shop.Search.results', $data);
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace App\Http\Requests\Shop;
use Illuminate\Foundation\Http\FormRequest;
class StoreOrderPost extends FormRequest
{
public function authorize()
{
return true;
}
public function rules()
{
return [
'user_id' => 'required',
];
}
}

View File

@@ -4,6 +4,9 @@ namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\View;
use App\View\Composers\Shop\LayoutComposer;
class AppServiceProvider extends ServiceProvider
{
@@ -25,5 +28,6 @@ class AppServiceProvider extends ServiceProvider
public function boot()
{
Schema::defaultStringLength(191);
View::composer('Shop.layout.layout', LayoutComposer::class);
}
}

View File

@@ -2,23 +2,19 @@
namespace App\Repositories;
use App\Repositories\Core\Auth\Users;
use App\Repositories\Users;
use App\Repositories\Shop\Categories;
use App\Repositories\Shop\Homepages;
class Config
{
public static function init()
{
$data['user'] = self::getUser();
return ['init' => $data];
}
public static function getUser()
{
if (Users::getUser()) {
$data = Users::getInfo();
} else {
$data = false;
}
return $data;
return [
'auth' => Users::getUser() ? Users::getInfo() : false,
'categories' => Categories::getTreeVisibles(),
'footer' => Homepages::getFooter(),
'extra_footer' => Homepages::getExtraFooter(),
];
}
}

View File

@@ -7,18 +7,14 @@ use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Str;
use Hyn\Tenancy\Database\Connection;
use Laratrust\Traits\LaratrustUserTrait;
use LangleyFoxall\LaravelNISTPasswordRules\PasswordRules;
use App\Models\Core\Auth\User;
use App\Models\Core\Auth\RoleUser;
use App\Repositories\Clients;
use App\Repositories\Partners;
use App\Repositories\Core\Upload;
use LangleyFoxall\LaravelNISTPasswordRules\PasswordRules;
class Users
{
use LaratrustUserTrait;
@@ -38,44 +34,26 @@ class Users
$data = $user->toArray();
$data['name'] = $user->name;
$data['avatar'] = self::getAvatar($id);
// $data['last_login'] = $user->previousLoginAt();
// $data['roles'] = self::getRoles();
// $data['permissions'] = self::getPermissions();
$data['roles'] = $user->roles->pluck('id')->toArray();
$data['permissions'] = $user->allPermissions()->pluck('id')->toArray();
$data['clients'] = $user->clients->pluck('id')->toArray();
return $data;
}
public static function store($data)
{
$id = isset($data['id']) ? $data['id'] : false;
if (!empty($data['password'])) {
$data['password'] = Hash::make($data['password']);
} else {
if ($id) {
unset($data['password']);
} else {
$data['password'] = Hash::make(Str::random(8));
}
if ($data['id'] ?? false) {
unset($data['password']);
}
$data['remember_token'] = Str::random(32);
$data['active'] = true;
$user = $id ? self::update($data, $id) : self::create($data);
$user = ($data['id'] ?? false) ? self::update($data) : self::create($data);
$user->roles()->sync(array_keys($data['roles'] ?? []));
UserClients::associate($user->id, $data['clients'] ?? false );
// $user->sendNewUserNotification($data['remember_token'], Auth::user());
return $user;
}
public static function create($data, $copy_password = false)
public static function create($data)
{
$data['password'] = $copy_password ? $data['password'] : ($data['password'] ? Hash::make($data['password']) : Hash::make(Str::random(8)));
$data['password'] = $data['password'] ?? Hash::make($data['password']);
$data['remember_token'] = Str::random(32);
$data['active'] = true;
$user = User::create($data);
PasswordSecurities::create($user->id);
return $user;
@@ -208,7 +186,7 @@ class Users
if (!$avatar) {
return '/assets/img/no-avatar.png';
}
$path = Clients::isClient() ? Clients::getPublicPath('/images/avatars/') : Partners::getPublicPath('/images/avatars/');
$path = '/images/avatars/';
return $path . $avatar;
}
@@ -242,16 +220,6 @@ class Users
return User::byUsername($username)->withTrashed()->first();
}
public static function select_by_status_and_team_and_entity($status_id, $team_id, $third_party_id)
{
return User::active()->byStatus($status_id)->byTeam($team_id)->byThirdParty($third_party_id)->get()->toArray();
}
public static function select_datas_by_id($user_id)
{
return User::with('status')->find($user_id)->toArray();
}
public static function toggle_active($id, $active)
{
return self::get($id)->update(['active' => $active]);
@@ -276,14 +244,11 @@ class Users
public static function update_password($id, $password)
{
$password = Hash::make($password);
UserClients::changePasswordsByUser($id, $password);
return User::find($id)->update(['password' => $password]);
// $connection = app(Connection::class);
// return User::on($connection->systemName())->find($id)->update(['password' => $password]);
}
public static function validate($username, $field = 'current_password')
{
return PasswordRules::changePassword($username, $field);
}
}
}

View File

@@ -451,7 +451,7 @@ class Articles
$tags[$tag['group']][] = $tag['name'];
}
}
return $tags;
return $tags ?? null;
}
public static function getPricesByArticle($article)

View File

@@ -18,6 +18,16 @@ class Homepages
return self::get(1)->text;
}
public static function getFooter()
{
return self::get(2)->text;
}
public static function getExtraFooter()
{
return self::get(3)->text;
}
public static function get($id)
{
return Homepage::find($id);

View File

@@ -0,0 +1,16 @@
<?php
namespace App\Repositories;
use App\Repositories\Core\Auth\Users as parentUsers;
use App\Repositories\Shop\SaleChannels;
class Users extends parentUsers
{
public static function getInfo($id = false)
{
$data = parent::getInfo($id);
$data['sale_channel'] = SaleChannels::getDefault()->toArray();
return $data;
}
}

View File

@@ -0,0 +1,14 @@
<?php
namespace App\View\Composers\Shop;
use Illuminate\View\View;
use App\Repositories\Config;
class LayoutComposer
{
public function compose(View $view)
{
$view->with(Config::init());
}
}

View File

@@ -51,8 +51,8 @@ a.green-dark:hover {
background-color: #F2B90F;
}
.bg-light {
background-color: #F5F5F5;
.bg-grey {
background-color: #AAA;
}
.yellow {

View File

@@ -53,7 +53,7 @@
'Ajout dans le panier',
'basket-form',
"{{ route('Shop.Basket.modalBasket') }}/" + offer_id + '/' + quantity,
"{{ route('Shop.Orders.create') }}",
"{{ route('Shop.Orders.order') }}",
false,
false,
true,

View File

@@ -28,47 +28,14 @@
@endforeach
</div>
<div class="col-4">
@component('components.card', ['class' => 'shadow bg-light'])
<div class="row mb-3">
<div class="col-6 text-uppercase">
Tarif appliqué
<span id="basket_sale_channel"></span>
</div>
<div class="col-6">
{{ $sale_channel['name'] ?? '' }}
</div>
</div>
<div class="row m-3">
<div class="col-6">
<span id="basket-count"></span> ARTICLES
</div>
<div class="col-6 text-right font-weight-bold">
<span id="basket-total"></span>
</div>
</div>
<div class="row m-3">
<div class="col-6">
LIVRAISON
</div>
<div class="col-6 text-right font-weight-bold">
<span id="shipping">5</span>
</div>
</div>
<hr>
<div class="row m-3 font-weight-bold" style="font-size: 1.6em;">
<div class="col-6">
TOTAL TTC
</div>
<div class="col-6 text-right">
<span id="basket-total-shipped"></span>
</div>
</div>
<x-card class='shadow bg-light'>
@include('Shop.Baskets.partials.basketTotal')
<div class="row m-3">
<div class="col-12 text-center">
<a href="" class="btn btn-green-dark">COMMANDER</a>
<a href="{{ route('Shop.Orders.order') }}" class="btn btn-green-dark">COMMANDER</a>
</div>
</div>
@endcomponent
</x-card>
</div>
</div>
@endif

View File

@@ -0,0 +1,35 @@
<div class="row mb-3">
<div class="col-6 text-uppercase">
Tarif appliqué :
</div>
<div class="col-6 text-right font-weight-bold">
<span id="basket_sale_channel">
{{ $sale_channel['name'] ?? null }}
</span>
</div>
</div>
<div class="row mb-3">
<div class="col-6">
<span id="basket-count">{{ $basket['count'] ?? 0 }}</span> ARTICLES
</div>
<div class="col-6 text-right font-weight-bold">
<span id="basket-total">{{ $basket['total'] ?? 0 }}</span>
</div>
</div>
<div class="row mb-3">
<div class="col-6">
LIVRAISON
</div>
<div class="col-6 text-right font-weight-bold">
<span id="shipping">5</span>
</div>
</div>
<hr>
<div class="row mb-3 font-weight-bold" style="font-size: 1.6em;">
<div class="col-6">
TOTAL TTC
</div>
<div class="col-6 text-right">
<span id="basket-total-shipped">{{ ($basket['total'] ?? 0) + 5 }}</span>
</div>
</div>

View File

@@ -0,0 +1,43 @@
@extends('Shop.layout.layout', [
'title' => __('Commande'),
])
@section('content')
<div class="row">
<div class="col-8">
Déja client ?
<button class="btn">Créez mon compte</button>
<x-layout.collapse id="identification" title="Déjà client">
@include('Shop.auth.partials.login')
</x-layout.collapse>
<x-layout.collapse id="personal_data" title="Informations personnelles">
@include('Shop.auth.partials.register')
</x-layout.collapse>
<x-layout.collapse id="adresses" title="Adresses">
</x-layout.collapse>
<x-layout.collapse id="delivery_mode" title="Mode de livraison">
</x-layout.collapse>
<x-layout.collapse id="payment" title="Paiement">
</x-layout.collapse>
</div>
<div class="col-4">
<x-card class='shadow bg-light'>
@include('Shop.Baskets.partials.basketTotal')
</x-card>
</div>
</div>
@endsection
@push('js')
<script>
</script>
@endpush

View File

@@ -1,9 +1,11 @@
<div class="row">
@if ($articles ?? false)
@foreach ($articles as $product_name => $article)
@if ((($product_type == 'botanic') && (($article['semences'] ?? false) || ($article['plants'] ?? false))) || (($product_type == 'merchandise') &&($article['mercchandises'] ?? false)))
<div class="col-3 mb-3">
@include('Shop.Articles.partials.article')
</div>
@endif
@endforeach
@endif
</div>

View File

@@ -4,45 +4,14 @@
])
@section('content')
{!! Form::open(['route' => 'Shop.login.post', 'method' => 'post', 'autocomplete'=> 'off']) !!}
<div class="row" style="width: 380px;">
<div class="col-12 text-center">
<img src="/img/logo.png" height="128">
</div>
</div>
<div class="form-group has-feedback">
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
{{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }}
<span class="fa fa-email form-control-feedback"></span>
{!! $errors->first('email','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="form-group has-feedback">
<div class="form-group {{ $errors->has('password') ? 'has-error' : '' }}">
{{ Form::password('password', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password')]) }}
<span class="fa fa-lock form-control-feedback"></span>
{!! $errors->first('password','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="row">
<div class="col-12 col-lg-6 mbs">
<button type="submit" class="btn btn-primary btn-block btn-flat">{{ __('Se connecter') }}</button>
</div>
<div class="col-12 col-lg-6">
<a href="{{ route('Shop.password.reset') }}">{{ __('Mot de passe oublié ?') }}</a><br>
<!--
<div class="checkbox icheck">
<label style="padding-left: 0">
<input type="checkbox" name="remember" class="icheck" {{ old('remember') ? 'checked' : '' }}>
{{ __('boilerplate::auth.login.rememberme') }}
</label>
</div>
-->
</div>
<div class="row" style="width: 380px;">
<div class="col-12 text-center">
<img src="/img/logo.png" height="128">
</div>
{!! Form::close() !!}
</div>
@include('Shop.auth.partials.login')
<p class="mt-3">
Vous n'avez pas encore de compte ?

View File

@@ -1,8 +0,0 @@
@if (config('app.name') == 'CRM')
@include('auth.crm')
@endif
@if (config('app.name') == 'HestImmo')
@include('auth.hestimmo')
@endif

View File

@@ -0,0 +1,34 @@
{!! Form::open(['route' => 'Shop.login.post', 'method' => 'post', 'autocomplete'=> 'off']) !!}
<div class="form-group has-feedback">
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
{{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }}
<span class="fa fa-email form-control-feedback"></span>
{!! $errors->first('email','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="form-group has-feedback">
<div class="form-group {{ $errors->has('password') ? 'has-error' : '' }}">
{{ Form::password('password', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password')]) }}
<span class="fa fa-lock form-control-feedback"></span>
{!! $errors->first('password','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="row">
<div class="col-12 col-lg-6 mbs">
<button type="submit" class="btn btn-primary btn-block btn-flat">{{ __('Se connecter') }}</button>
</div>
<div class="col-12 col-lg-6">
<a href="{{ route('Shop.password.reset') }}">{{ __('Mot de passe oublié ?') }}</a><br>
<!--
<div class="checkbox icheck">
<label style="padding-left: 0">
<input type="checkbox" name="remember" class="icheck" {{ old('remember') ? 'checked' : '' }}>
{{ __('boilerplate::auth.login.rememberme') }}
</label>
</div>
-->
</div>
</div>
{!! Form::close() !!}

View File

@@ -0,0 +1,117 @@
{!! Form::open(['route' => 'Shop.register.post', 'method' => 'post', 'autocomplete'=> 'off']) !!}
<div class="row">
<div class="col-12">
<x-card title='Créez votre compte' class='mt-3 mb-3'>
<div class="row">
<div class="col-6">
<div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
{{ Form::text('first_name', old('first_name'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.first_name'), 'required', 'autofocus']) }}
{!! $errors->first('first_name','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="col-6">
<div class="form-group {{ $errors->has('last_name') ? 'has-error' : '' }}">
{{ Form::text('last_name', old('last_name'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.last_name'), 'required']) }}
{!! $errors->first('last_name','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="form-group {{ $errors->has('company') ? 'has-error' : '' }}">
{{ Form::text('company', old('company'), ['class' => 'form-control', 'placeholder' => __('Société'), 'autofocus']) }}
{!! $errors->first('company','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="form-group {{ $errors->has('tva') ? 'has-error' : '' }}">
{{ Form::text('tva', old('tva'), ['class' => 'form-control', 'placeholder' => __('N° de TVA'), 'autofocus']) }}
{!! $errors->first('tva','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
</div>
<div class="row">
<div class="col-6">
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
{{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required']) }}
{!! $errors->first('email','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="col-6">
<div class="form-group {{ $errors->has('phone') ? 'has-error' : '' }}">
{{ Form::text('phone', old('phone'), ['class' => 'form-control', 'placeholder' => __('phone')]) }}
{!! $errors->first('phone','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="form-group {{ $errors->has('address') ? 'has-error' : '' }}">
{{ Form::text('address', old('address'), ['class' => 'form-control', 'placeholder' => __('Adresse de livraison'), 'required']) }}
{!! $errors->first('address','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="form-group {{ $errors->has('address2') ? 'has-error' : '' }}">
{{ Form::text('address2', old('address2'), ['class' => 'form-control', 'placeholder' => __('Complément d\'adresse'), 'required']) }}
{!! $errors->first('address2','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
</div>
<div class="row">
<div class="col-4">
<div class="form-group {{ $errors->has('zipcode') ? 'has-error' : '' }}">
{{ Form::text('zipcode', old('zipcode'), ['class' => 'form-control', 'placeholder' => __('zipcode'), 'required']) }}
{!! $errors->first('zipcode','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="col-8">
<div class="form-group {{ $errors->has('city') ? 'has-error' : '' }}">
{{ Form::text('city', old('city'), ['class' => 'form-control', 'placeholder' => __('city'), 'required']) }}
{!! $errors->first('city','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
</div>
<div class="row">
<div class="col-6">
<div class="form-group {{ $errors->has('password') ? 'has-error' : '' }}">
{{ Form::password('password', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password'), 'required']) }}
{!! $errors->first('password','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="col-6">
<div class="form-group {{ $errors->has('password_confirmation') ? 'has-error' : '' }}">
{{ Form::password('password_confirmation', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password_confirm'), 'required']) }}
{!! $errors->first('password_confirmation','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
</div>
<div class="row">
<div class="col-12">
@include('components.form.checkbox', ['name' => 'use_for_invoice', 'value' => false])
Utiliser aussi cette adresse pour la facturation
</div>
</div>
</x-card>
<div class="row mbm">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center">
<button type="submit" class="btn btn-primary">
{{ __('boilerplate::auth.register.register_button') }}
</button>
</div>
</div>
</div>
</div>
{!! Form::close() !!}

View File

@@ -4,97 +4,5 @@
])
@section('content')
{!! Form::open(['route' => 'Shop.register.post', 'method' => 'post', 'autocomplete'=> 'off']) !!}
<div class="row">
<div class="col-8">
@component('components.card', ['title' => 'Créez votre compte', 'class' => 'mt-3 mb-3'])
<div class="row">
<div class="col-6">
<div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
{{ Form::text('first_name', old('first_name'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.first_name'), 'required', 'autofocus']) }}
{!! $errors->first('first_name','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="col-6">
<div class="form-group {{ $errors->has('last_name') ? 'has-error' : '' }}">
{{ Form::text('last_name', old('last_name'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.last_name'), 'required']) }}
{!! $errors->first('last_name','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
</div>
<div class="row">
<div class="col-6">
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
{{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required']) }}
{!! $errors->first('email','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="col-6">
<div class="form-group {{ $errors->has('phone') ? 'has-error' : '' }}">
{{ Form::text('phone', old('phone'), ['class' => 'form-control', 'placeholder' => __('phone'), 'required']) }}
{!! $errors->first('phone','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="form-group {{ $errors->has('address') ? 'has-error' : '' }}">
{{ Form::text('address', old('address'), ['class' => 'form-control', 'placeholder' => __('Adresse'), 'required']) }}
{!! $errors->first('address','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="form-group {{ $errors->has('address2') ? 'has-error' : '' }}">
{{ Form::text('address2', old('address2'), ['class' => 'form-control', 'placeholder' => __('Complément d\'adresse'), 'required']) }}
{!! $errors->first('address2','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
</div>
<div class="row">
<div class="col-4">
<div class="form-group {{ $errors->has('zipcode') ? 'has-error' : '' }}">
{{ Form::text('zipcode', old('zipcode'), ['class' => 'form-control', 'placeholder' => __('zipcode'), 'required']) }}
{!! $errors->first('zipcode','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="col-8">
<div class="form-group {{ $errors->has('city') ? 'has-error' : '' }}">
{{ Form::text('city', old('city'), ['class' => 'form-control', 'placeholder' => __('city'), 'required']) }}
{!! $errors->first('city','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
</div>
<div class="row">
<div class="col-6">
<div class="form-group {{ $errors->has('password') ? 'has-error' : '' }}">
{{ Form::password('password', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password'), 'required']) }}
{!! $errors->first('password','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="col-6">
<div class="form-group {{ $errors->has('password_confirmation') ? 'has-error' : '' }}">
{{ Form::password('password_confirmation', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password_confirm'), 'required']) }}
{!! $errors->first('password_confirmation','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
</div>
@endcomponent
<div class="row mbm">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center">
<button type="submit" class="btn btn-primary">
{{ __('boilerplate::auth.register.register_button') }}
</button>
</div>
</div>
</div>
</div>
{!! Form::close() !!}
@include('Shop.auth.partials.register')
@endsection

View File

@@ -1,3 +1,5 @@
<footer id="footer">
<hr>
{!! $footer ?? null !!}
{!! $extra_footer ?? null !!}
</footer>

View File

@@ -4,43 +4,11 @@
])
@section('content')
{!! Form::open(['route' => 'boilerplate.login', 'method' => 'post', 'autocomplete'=> 'off']) !!}
<div class="row" style="width: 380px;">
<div class="col-12 text-center">
<img src="/img/logo.png" height="128">
</div>
<div class="row" style="width: 380px;">
<div class="col-12 text-center">
<img src="/img/logo.png" height="128">
</div>
<div class="form-group has-feedback">
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
{{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }}
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
{!! $errors->first('email','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="form-group has-feedback">
<div class="form-group {{ $errors->has('password') ? 'has-error' : '' }}">
{{ Form::password('password', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password')]) }}
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
{!! $errors->first('password','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="row">
<div class="col-12 col-lg-8">
<div class="checkbox icheck">
<label style="padding-left: 0">
<input type="checkbox" name="remember" class="icheck" {{ old('remember') ? 'checked' : '' }}>
{{ __('boilerplate::auth.login.rememberme') }}
</label>
</div>
</div>
<div class="col-12 col-lg-4 mbs">
<button type="submit" class="btn btn-primary btn-block btn-flat">{{ __('boilerplate::auth.login.signin') }}</button>
</div>
</div>
{!! Form::close() !!}
<a href="{{ route('boilerplate.password.request') }}">{{ __('boilerplate::auth.login.forgotpassword') }}</a><br>
@if(config('boilerplate.auth.register'))
<a href="{{ route('boilerplate.register') }}" class="text-center">{{ __('boilerplate::auth.login.register') }}</a>
@endif
</div>
@include('auth.partials.login')
@endsection

View File

@@ -1,8 +0,0 @@
@if (config('app.name') == 'CRM')
@include('auth.crm')
@endif
@if (config('app.name') == 'HestImmo')
@include('auth.hestimmo')
@endif

View File

@@ -0,0 +1,35 @@
{!! Form::open(['route' => 'boilerplate.login', 'method' => 'post', 'autocomplete'=> 'off']) !!}
<div class="form-group has-feedback">
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
{{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }}
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
{!! $errors->first('email','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="form-group has-feedback">
<div class="form-group {{ $errors->has('password') ? 'has-error' : '' }}">
{{ Form::password('password', ['class' => 'form-control', 'placeholder' => __('boilerplate::auth.fields.password')]) }}
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
{!! $errors->first('password','<p class="text-danger"><strong>:message</strong></p>') !!}
</div>
</div>
<div class="row">
<div class="col-12 col-lg-8">
<div class="checkbox icheck">
<label style="padding-left: 0">
<input type="checkbox" name="remember" class="icheck" {{ old('remember') ? 'checked' : '' }}>
{{ __('boilerplate::auth.login.rememberme') }}
</label>
</div>
</div>
<div class="col-12 col-lg-4 mbs">
<button type="submit" class="btn btn-primary btn-block btn-flat">{{ __('boilerplate::auth.login.signin') }}</button>
</div>
</div>
{!! Form::close() !!}
<a href="{{ route('boilerplate.password.request') }}">{{ __('boilerplate::auth.login.forgotpassword') }}</a><br>
@if(config('boilerplate.auth.register'))
<a href="{{ route('boilerplate.register') }}" class="text-center">{{ __('boilerplate::auth.login.register') }}</a>
@endif

View File

@@ -0,0 +1,29 @@
<div class="card {{ $class ?? '' }}">
<div class="card-header p-0">
<div class="row">
<div class="{{ ($collapse_right ?? false) ? 'col-6' : 'col-12' }}">
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#{{ $id }}" aria-expanded="false" aria-controls="{{ $id }}">
<i class="fa {{ ($collapsed ?? true) ? 'fa-chevron-right' : 'fa-chevron-down' }}"></i>
</button>
{!! $title ?? null !!}
@if (isset($required) && $required)
<sup>*</sup>
@endif
{!! $collapse_left ?? '' !!}
<span class="check ml-5 error"></span>
</div>
@if ($collapse_right ?? false)
<div class="col-6">
{!! $collapse_right ?? '' !!}
</div>
@endif
</div>
</div>
<div id="{{ $id }}" class="card-body collapse {{ ($collapsed ?? true) ? '' : 'show' }} {{ $class_body ?? '' }}">
{{ $slot }}
</div>
</div>
@include('load.layout.chevron')

View File

@@ -3,12 +3,10 @@
<div class="row mb-2 align-items-end">
<div class="col-sm-6">
<h1 class="m-0 text-dark">
@if(isset($title))
{{ $title }}
@endif
@if(isset($subtitle))
{{ $title ?? null}}
@isset($subtitle)
<small class="font-weight-light ml-1 text-md">{{ $subtitle }}</small>
@endif
@endisset
</h1>
</div>
<div class="col-sm-6">

View File

@@ -1,11 +1,6 @@
<?php
Route::prefix('Orders')->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('order', 'OrderController@order')->name('order');
});