many updates
This commit is contained in:
parent
3632ae71c1
commit
6bd3b3fca8
@ -7,8 +7,6 @@
|
||||
use App\Models\Agent;
|
||||
use App\Models\Company;
|
||||
|
||||
|
||||
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
@ -81,7 +79,9 @@ protected function create(array $data)
|
||||
'name' => $data['name'],
|
||||
'inn' => $data['inn'],
|
||||
'email' => $data['email'],
|
||||
'type' => $data['type']
|
||||
'type' => $data['type'],
|
||||
'secret' => bin2hex(random_bytes(16)),
|
||||
'status' => 'new'
|
||||
]);
|
||||
|
||||
Agent::create([
|
||||
|
||||
@ -13,10 +13,11 @@ public function index() {
|
||||
$admin = CompanyAdmin::where('user_id', $user->id);
|
||||
if ($admin->count()) {
|
||||
$admin = $admin->first();
|
||||
return view('agent.table', [
|
||||
return view('company.agents.table', [
|
||||
'agents' => Agent::where('company_id', $admin->company_id)->get()
|
||||
]);
|
||||
} else {
|
||||
echo 'has no permissions';
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
38
app/Http/Controllers/Company/ConfirmCompanyController.php
Normal file
38
app/Http/Controllers/Company/ConfirmCompanyController.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Company;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
|
||||
use App\Models\Company\Company;
|
||||
use App\Models\Company\CompanyAdmin;
|
||||
use App\Models\User;
|
||||
|
||||
class ConfirmCompanyController extends Controller
|
||||
{
|
||||
public function __invoke(Request $request)
|
||||
{
|
||||
$company = Company::find($request->company_id);
|
||||
if ($company->secret == $request->secret) {
|
||||
$company->status = $request->status;
|
||||
$company->save();
|
||||
$user = User::where('email', $company->email);
|
||||
if ($user->count() == 1) {
|
||||
$user = $user->first();
|
||||
} else {
|
||||
$user = User::create([
|
||||
'name' => $request->user_name,
|
||||
'email' => $company->email,
|
||||
'phone' => $request->user_phone,
|
||||
'password' => uniqid(),
|
||||
]);
|
||||
}
|
||||
CompanyAdmin::create([
|
||||
'user_id' => $user->id,
|
||||
'company_id' => $company->id
|
||||
]);
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -4,8 +4,10 @@
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Company;
|
||||
use App\Models\Company\Company;
|
||||
|
||||
|
||||
use App\Models\Bitrix\SendCompany;
|
||||
class CreateCompanyController extends Controller
|
||||
{
|
||||
/**
|
||||
@ -13,9 +15,16 @@ class CreateCompanyController extends Controller
|
||||
*/
|
||||
public function __invoke(Request $request)
|
||||
{
|
||||
$company = Company::create($request->only('name', 'email', 'inn', 'legal_address'));
|
||||
$request->request->add([
|
||||
'secret' => bin2hex(random_bytes(16)),
|
||||
'status' => 'new',
|
||||
'type' => 'AGENCY'
|
||||
]);
|
||||
$company = Company::create($request->only('name', 'email', 'inn', 'legal_address', 'secret', 'status', 'type'));
|
||||
if ($company) {
|
||||
return view('company.create');
|
||||
$companyConfirmByBitrix = new SendCompany($company);
|
||||
$companyConfirmByBitrix->send();
|
||||
return view('company.created');
|
||||
} else {
|
||||
return back()->withInputs();
|
||||
}
|
||||
|
||||
@ -5,12 +5,23 @@
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\Company\Company;
|
||||
use App\Models\Company\Details;
|
||||
use App\Models\Agent;
|
||||
|
||||
class DetailsController extends Controller
|
||||
{
|
||||
public function index(Company $company) {
|
||||
public function index() {
|
||||
$company = false;
|
||||
$userId = auth()->user()->id;
|
||||
$agent = Agent::where('user_id', $userId)->get();
|
||||
if ($agent->count() == 1) {
|
||||
$agent = $agent->first();
|
||||
$company = Company::find($agent->company_id);
|
||||
} else {
|
||||
return back();
|
||||
};
|
||||
|
||||
$details = new Details($company);
|
||||
$details = $details->details;
|
||||
if ($company->type == 'SELFEMP') {
|
||||
@ -27,6 +38,17 @@ public function index(Company $company) {
|
||||
};
|
||||
}
|
||||
public function store(Request $request, Company $company) {
|
||||
$userId = auth()->user()->id;
|
||||
$agent = Agent::where('user_id', $userId)->get();
|
||||
if ($agent->count() == 1) {
|
||||
$agent = $agent->first();
|
||||
if ($agent->company_id != $company->id) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return back();
|
||||
};
|
||||
|
||||
$company->details = $request->all();
|
||||
$company->save();
|
||||
return to_route('company.details', [
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
use App\Models\Complex;
|
||||
use App\Models\Status;
|
||||
use App\Models\Agent;
|
||||
use App\Models\BitrixSender;
|
||||
use App\Models\Bitrix\SendClient;
|
||||
|
||||
|
||||
class CreateClientForm extends Component
|
||||
@ -123,7 +123,6 @@ public function save() {
|
||||
public function sendToBitrix($id) {
|
||||
$user = auth()->user();
|
||||
$agent = Agent::where('user_id', $user->id)->first();
|
||||
//dd($agent->user->name);
|
||||
$agentName = $agent->user->getPartialsName();
|
||||
$data = [
|
||||
'CLIENT_FIRST_NAME' => $this->client['firstName'],
|
||||
@ -136,7 +135,7 @@ public function sendToBitrix($id) {
|
||||
'OBJECT_NAME' => Complex::find($this->client['complexId'])->name,
|
||||
'CALLBACK_URL' => route('deal.confirm', ['hash' => $this->client['confirmToken']]),
|
||||
];
|
||||
$sender = new BitrixSender($id, $data);
|
||||
$sender = new SendClient($id, $data);
|
||||
$response = $sender->send();
|
||||
if ($response) {
|
||||
return $response;
|
||||
|
||||
48
app/Models/Bitrix/BitrixSender.php
Normal file
48
app/Models/Bitrix/BitrixSender.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Bitrix;
|
||||
use App\Models\Company;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class BitrixSender
|
||||
{
|
||||
public $url;
|
||||
public $data;
|
||||
public function __construct($url, $data) {
|
||||
$this->url = $url;
|
||||
$this->data = $data;
|
||||
}
|
||||
public function send() {
|
||||
$postdata = http_build_query(
|
||||
$this->data
|
||||
);
|
||||
$opts = array(
|
||||
'ssl' => array(
|
||||
'verify_peer' => false,
|
||||
'verify_peername' => false
|
||||
),
|
||||
'http' => array(
|
||||
'method' => 'POST',
|
||||
'header' =>
|
||||
'Content-type: application/x-www-form-urlencoded'."\r\n".
|
||||
'',
|
||||
'content' => $postdata
|
||||
)
|
||||
);
|
||||
|
||||
try {
|
||||
$context = stream_context_create($opts);
|
||||
$result = file_get_contents($this->url, false, $context);
|
||||
$result = json_decode($result, $associative = true);
|
||||
if (array_key_exists('result', $result)) {
|
||||
return $result['result'];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
dd($e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
namespace App\Models\Bitrix;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class BitrixSender
|
||||
class SendClient
|
||||
{
|
||||
private $IBLOCK_TYPE_ID = 'lists';
|
||||
|
||||
@ -21,20 +21,6 @@ class BitrixSender
|
||||
const BROKER_PHONE = "PROPERTY_99";
|
||||
const OBJECT_NAME = "PROPERTY_100";
|
||||
const CALLBACK_URL = "PROPERTY_105";
|
||||
|
||||
//CONFIG для VSSDOM
|
||||
/*
|
||||
private $URL = 'https://crm.vssdom.ru/rest/8802/diju1sn3w7rbuhmm/lists.element.add.json';
|
||||
private $IBLOCK_ID = 52;
|
||||
const CLIENT_SECOND_NAME = "PROPERTY_118";
|
||||
const CLIENT_FIRST_NAME = "PROPERTY_119";
|
||||
const CLIENT_PHONE = "PROPERTY_120";
|
||||
const BROKER_SECOND_NAME = "PROPERTY_121";
|
||||
const BROKER_FIRST_NAME = "PROPERTY_122";
|
||||
const BROKER_PHONE = "PROPERTY_123";
|
||||
const OBJECT_NAME = "PROPERTY_124";
|
||||
const CALLBACK_URL = "PROPERTY_128";
|
||||
*/
|
||||
private $data = [];
|
||||
|
||||
public function __construct($id, $data) {
|
||||
64
app/Models/Bitrix/SendCompany.php
Normal file
64
app/Models/Bitrix/SendCompany.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Bitrix;
|
||||
use App\Models\Company\Company;
|
||||
use App\Models\Bitrix\BitrixSender;
|
||||
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class SendCompany
|
||||
{
|
||||
private $IBLOCK_TYPE_ID = 'rest_entity';
|
||||
|
||||
//CONFIG для Альфы
|
||||
|
||||
private $URL = 'https://b24alfa.pro/rest/3165/v90a792nderzu0dj/lists.element.add.json';
|
||||
private $IBLOCK_ID = 24;
|
||||
private $ID;
|
||||
const NAME = "NAME";
|
||||
const INN = "PROPERTY_118";
|
||||
const PHONE = "PROPERTY_121";
|
||||
const EMAIL = "PROPERTY_120";
|
||||
const LEGAL_ADDRESS = "PROPERTY_119";
|
||||
const CALLBACK_URL = "PROPERTY_122";
|
||||
private $data = [];
|
||||
|
||||
public function __construct(Company $company) {
|
||||
$this->ID = $company->id;
|
||||
$data = array_change_key_case($company->attributesToArray(), CASE_UPPER);
|
||||
$finalData = $this->castConstants($data);
|
||||
$finalData[self::CALLBACK_URL] = route('company.status.update', [
|
||||
'company' => $this->ID
|
||||
]);
|
||||
$this->data = $finalData;
|
||||
return;
|
||||
}
|
||||
|
||||
private function castConstants($data) {
|
||||
$finalData = [];
|
||||
$refl = new \ReflectionClass(__CLASS__);
|
||||
$constants = $refl->getConstants();
|
||||
foreach ( $constants as $constName => $constValue )
|
||||
{
|
||||
foreach ($data as $key => $value)
|
||||
{
|
||||
if ( $constName == $key ) {
|
||||
$finalData[$constValue] = $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $finalData;
|
||||
}
|
||||
public function send() {
|
||||
$data = [
|
||||
'IBLOCK_TYPE_ID' => $this->IBLOCK_TYPE_ID,
|
||||
'IBLOCK_ID' => $this->IBLOCK_ID,
|
||||
'ELEMENT_CODE' => $this->ID,
|
||||
'FIELDS' => $this->data,
|
||||
'PROPERTY_VALUES' => $this->data
|
||||
];
|
||||
$sender = new BitrixSender($this->URL, $data);
|
||||
$sender->send();
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
namespace App\Models\Company;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@ -9,6 +9,9 @@ class Company extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
const STATUS_NEW = 'new';
|
||||
const STATUS_ACCEPTED = 'accepted';
|
||||
const STATUS_DECLINED = 'declined';
|
||||
protected $fillable = [
|
||||
'type',
|
||||
'name',
|
||||
@ -17,7 +20,9 @@ class Company extends Model
|
||||
'email',
|
||||
'address',
|
||||
'legal_address',
|
||||
'details'
|
||||
'details',
|
||||
'status',
|
||||
'secret'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
@ -8,6 +8,9 @@
|
||||
class CompanyAdmin extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'company_id'
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
|
||||
class User extends Authenticatable
|
||||
class User extends Authenticatable implements MustVerifyEmail
|
||||
{
|
||||
use HasApiTokens, HasFactory, Notifiable;
|
||||
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('companies', function (Blueprint $table) {
|
||||
$table->enum('status', ['new', 'accepted', 'declined']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('companies', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
};
|
||||
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('companies', function (Blueprint $table) {
|
||||
$table->string('secret');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('companies', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
};
|
||||
BIN
public/images/LabRes-20241120053708844406.pdf
Normal file
BIN
public/images/LabRes-20241120053708844406.pdf
Normal file
Binary file not shown.
43
resources/views/company/agents/table.blade.php
Normal file
43
resources/views/company/agents/table.blade.php
Normal file
@ -0,0 +1,43 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div>
|
||||
<form class="d-flex mb-3" method="GET" action="{{ route('clients.table') }}">
|
||||
<div class="p-2 border rounded-3 border-1 p-1 bg-white">
|
||||
<input type="radio" class="btn-check" name="status" value="all" id="option5" autocomplete="off"
|
||||
onclick="this.form.submit()" {{ $status == 'all' ? 'checked' : '' }}>
|
||||
<label class="btn p-2 fs-5" for="option5">Все</label>
|
||||
|
||||
<input type="radio" class="btn-check" name="status" value="unique" id="option6" autocomplete="off"
|
||||
onclick="this.form.submit()" {{ $status == 'unique' ? 'checked' : '' }}>
|
||||
<label class="btn p-2 fs-5" for="option6">Уникальные</label>
|
||||
|
||||
<input type="radio" class="btn-check" name="status" value="not unique" id="option7" autocomplete="off"
|
||||
onclick="this.form.submit()" {{ $status == 'not unique' ? 'checked' : '' }}>
|
||||
<label class="btn p-2 fs-5" for="option7">Не
|
||||
уникальные</label>
|
||||
</div>
|
||||
<div class="ms-auto p-2">
|
||||
<select class="form-select form-select-lg" aria-label="Large select example">
|
||||
<option selected="">Город: любой</option>
|
||||
@foreach ($cities as $city)
|
||||
<option selected="">{{ $city->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
@if (!$status || $status == 'all' || $status == 'unique')
|
||||
<h4 class="fw-bold mt-5 mb-3">Уникальные</h4>
|
||||
<div class="fs-5 bg-light mb-2">
|
||||
@livewire('clientsTable', ['status' => 'UNIQUE'])
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (!$status || $status == 'all' || $status == 'not unique')
|
||||
<h4 class="fw-bold mt-5 mb-3">Не уникальные</h4>
|
||||
<div class="fs-5 bg-light mb-2">
|
||||
@livewire('clientsTable', ['status' => 'NOT UNIQUE'])
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
@ -1,27 +1,39 @@
|
||||
@extends('layouts.guest')
|
||||
|
||||
@section('content')
|
||||
<form action="{{ route('company.create') }}" method="post">
|
||||
@csrf
|
||||
<div class="mb-3">
|
||||
<label for="companyName" class="form-label">Название компании</label>
|
||||
<input type="text" class="form-control" id="companyName" name="name">
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Create company form') }}</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="companyInn" class="form-label">ИНН</label>
|
||||
<input type="text" class="form-control" id="companyInn" name="inn">
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('company.create') }}" method="post">
|
||||
@csrf
|
||||
<div class="mb-3">
|
||||
<label for="companyName" class="form-label">Название компании</label>
|
||||
<input type="text" class="form-control" id="companyName" name="name">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="companyEmail" class="form-label">Электронная почта</label>
|
||||
<input type="text" class="form-control" id="companyEmail" name="email">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="companyLegalAddress" class="form-label">Юридический адрес</label>
|
||||
<input type="text" class="form-control" id="companyLegalAddress" name="legal_address">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="companyInn" class="form-label">ИНН</label>
|
||||
<input type="text" class="form-control" id="companyInn" name="inn">
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn btn-primary" name="Отправить заявку">
|
||||
</form>
|
||||
<div class="mb-3">
|
||||
<label for="companyEmail" class="form-label">Электронная почта</label>
|
||||
<input type="text" class="form-control" id="companyEmail" name="email">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="companyLegalAddress" class="form-label">Юридический адрес</label>
|
||||
<input type="text" class="form-control" id="companyLegalAddress" name="legal_address">
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn btn-primary" name="Отправить заявку">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
10
resources/views/company/created.blade.php
Normal file
10
resources/views/company/created.blade.php
Normal file
@ -0,0 +1,10 @@
|
||||
@extends('layouts.guest')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
Отлично! Мы направили Вашу заявку на модерацию. Как только заявка на подключение будет обработана, мы направим
|
||||
Вам на электронную почту дальнейшие инструкции!
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
31
resources/views/company/post_confirmer.blade.php
Normal file
31
resources/views/company/post_confirmer.blade.php
Normal file
@ -0,0 +1,31 @@
|
||||
@extends('layouts.guest')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<form action="{{ route('company.status.update') }}" method="post">
|
||||
<p>
|
||||
company_id:<br>
|
||||
<input type="text" name="company_id">
|
||||
</p>
|
||||
<p>
|
||||
secret:<br>
|
||||
<input type="text" name="secret">
|
||||
</p>
|
||||
<p>
|
||||
status:<br>
|
||||
<input type="text" name="status">
|
||||
</p>
|
||||
<p>
|
||||
user_name:<br>
|
||||
<input type="text" name="user_name">
|
||||
</p>
|
||||
<p>
|
||||
user_phone:<br>
|
||||
<input type="text" name="user_phone">
|
||||
</p>
|
||||
<button type="submit">Send</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@ -21,33 +21,23 @@
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
@vite(['resources/sass/app.scss', 'resources/js/app.js', 'resources/css/app.css'])
|
||||
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100% !important
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container text-center">
|
||||
<nav class="navbar bg-body-tertiary">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand">
|
||||
<img src={{ url('/images/logo.png') }} alt="Bootstrap" width="70">
|
||||
</a>
|
||||
<li class="nav-item dropdown d-flex">
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="bi bi-person" style="font-size: 1.5rem"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" href="{{ route('login') }}">Войти</a></li>
|
||||
<li><a class="dropdown-item" href="{{ route('register') }}">Зарегистрироваться</a></li>
|
||||
<li><a class="dropdown-item" href="{{ route('company.form.create') }}">Создать компанию</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<body class="d-flex align-items-center py-4 bg-body-tertiary">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8 text-center">
|
||||
<img src={{ url('/images/logo.png') }} alt="Alfa logo" width="70">
|
||||
</div>
|
||||
</nav>
|
||||
<div class="">
|
||||
@yield('content')
|
||||
</div>
|
||||
@yield('content')
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@ -12,13 +12,13 @@ class="nav-link d-flex align-items-center gap-2 fs-5 border rounded-4 active" ar
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item text-center m-2">
|
||||
<a href="{{ route('clients.table') }}"
|
||||
<a href="{{ route('agents.table') }}"
|
||||
class="nav-link d-flex align-items-center gap-2 fs-5 border rounded-4 active" aria-current="page">
|
||||
<i class="bi bi-people"></i> Агенты
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item text-center m-2">
|
||||
<a href="{{ route('company.details', ['company' => 1]) }}"
|
||||
<a href="{{ route('company.details') }}"
|
||||
class="nav-link d-flex align-items-center gap-2 fs-5 border rounded-4 active" aria-current="page">
|
||||
<i class="bi bi-gear"></i> Настройки
|
||||
</a>
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
@extends('layouts.guest')
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<a href="" class="btn btn-primary">Создать организацию</a>
|
||||
</div>
|
||||
<div class="col">
|
||||
<a href="" class="btn btn-primary">Войти</a>
|
||||
</div>
|
||||
</div>
|
||||
<main class="form-signin w-100 m-auto" style="max-width: 330px;">
|
||||
|
||||
<a class="btn btn-primary w-100 py-2 mb-2" href="{{ route('login') }}">Войти</a>
|
||||
<a class="btn btn-secondary w-100 py-2 mb-2" href="{{ route('register') }}">Зарегистрироваться</a>
|
||||
<a class="btn btn-secondary w-100 py-2 mb-2" href="{{ route('company.form.create') }}">Создать компанию</a>
|
||||
</main>
|
||||
@endsection
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
use App\Http\Controllers\ConfirmClientFromBitrix;
|
||||
|
||||
use App\Http\Controllers\Company\ConfirmCompanyController;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@ -22,3 +22,4 @@
|
||||
});
|
||||
|
||||
Route::post('/client/confirm', [ConfirmClientFromBitrix::class, 'confirm'])->name('deal.confirm');
|
||||
Route::post('/company/status/update', ConfirmCompanyController::class)->name('company.status.update');
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
use Illuminate\Foundation\Auth\EmailVerificationRequest;
|
||||
|
||||
use App\Http\Controllers\Company\CreateCompanyController;
|
||||
|
||||
/*
|
||||
@ -19,19 +21,27 @@
|
||||
return view(view: 'welcome');
|
||||
});
|
||||
|
||||
Auth::routes();
|
||||
Route::get('/email/verify/{id}/{hash}', function (EmailVerificationRequest $request) {
|
||||
$request->fulfill();
|
||||
|
||||
return redirect('/home');
|
||||
})->middleware(['auth', 'signed'])->name('verification.verify');
|
||||
|
||||
//Company
|
||||
Route::get('/company/create', function () {
|
||||
return view(view: 'company.create');
|
||||
})->name('company.form.create');
|
||||
|
||||
Route::post('/company/create', CreateCompanyController::class)->name('company.create');
|
||||
Route::get('/company/confirmer', function ()
|
||||
{
|
||||
return view(view: 'company.post_confirmer');
|
||||
});
|
||||
|
||||
Auth::routes();
|
||||
Route::post('/company/create', CreateCompanyController::class)->name('company.create');
|
||||
|
||||
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
|
||||
Route::get('/clients/table', [App\Http\Controllers\ClientsTableController::class, 'index'])->name('clients.table');
|
||||
Route::get('/company/{company}/details/', [App\Http\Controllers\Company\DetailsController::class, 'index'])->name('company.details');
|
||||
Route::get('/company/details/', [App\Http\Controllers\Company\DetailsController::class, 'index'])->name('company.details');
|
||||
Route::post('/company/{company}/details/', [App\Http\Controllers\Company\DetailsController::class, 'store'])->name('company.details.store');
|
||||
|
||||
|
||||
|
||||
Route::get('/agents/table', [App\Http\Controllers\Company\AgentsTableController::class, 'index'])->name('agents.table');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user