wip
parent
125633214d
commit
453abd9776
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum ShippingType: string
|
||||
{
|
||||
case THEY_SHIP = 'They ship';
|
||||
case WE_SHIP = 'We ship';
|
||||
case PICKUP = 'Pickup';
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\ContactRequest;
|
||||
use App\Models\Contact;
|
||||
use App\Models\Customer;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ContactController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
{
|
||||
return view('contacts.create', [
|
||||
'customers' => Customer::all(),
|
||||
'fromCustomer' => $request->get('customer'),
|
||||
]);
|
||||
}
|
||||
|
||||
public function store(ContactRequest $request)
|
||||
{
|
||||
$contact = Contact::create($request->validated());
|
||||
|
||||
return redirect()->route('customers.show', [$contact->customer, 'contacts'])->with('status', 'Contact created successfully');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
}
|
||||
|
||||
public function requestDestroy(Request $request)
|
||||
{
|
||||
$contact = Contact::find($request->get('contact'));
|
||||
$contact->delete();
|
||||
|
||||
return redirect()->route('customers.show', [$contact->customer->id, 'contacts'])->with('status', 'Contact deleted successfully');
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
// $contact = Contact::findOrFail($id);
|
||||
// $contact->delete();
|
||||
//
|
||||
// return redirect()->route('customers.show', $contact->customer()->iud)->with('status', 'Contact deleted successfully');
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\PackingSlipRequest;
|
||||
use App\Models\Customer;
|
||||
use App\Models\PackingSlip;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PackingSlipController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
}
|
||||
|
||||
public function store(PackingSlipRequest $request)
|
||||
{
|
||||
PackingSlip::create($request->validated());
|
||||
|
||||
if ($request->get('from_customer'))
|
||||
{
|
||||
return redirect()->route('customers.show', [
|
||||
Customer::find($request->get('customer_id')),
|
||||
'tab' => 'packing'
|
||||
]);
|
||||
}
|
||||
|
||||
return redirect()->back(); //todo: change to packing slips page
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\ShippingEntryRequest;
|
||||
use App\Models\ShippingEntry;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ShippingEntryController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
}
|
||||
|
||||
public function store(ShippingEntryRequest $request)
|
||||
{
|
||||
$entry = ShippingEntry::create($request->validated());
|
||||
|
||||
return redirect()->route('customers.show', [$entry->customer, 'tab' => 'shipping']);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ContactRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
// todo: required first name if no last name and vice versa
|
||||
|
||||
return [
|
||||
'customer_id' => 'required|exists:customers,id',
|
||||
'first_name' => 'string',
|
||||
'last_name' => 'string',
|
||||
'email' => 'string',
|
||||
'phone' => 'string',
|
||||
'notes' => 'string'
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class PackingSlipRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'date_received' => 'required|date',
|
||||
'customer_id' => 'required|exists:customers,id',
|
||||
'order_id' => 'string|nullable',
|
||||
'amount' => 'required|string',
|
||||
'contents' => 'required|string',
|
||||
'from_customer' => 'required|bool'
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ShippingEntryRequest extends FormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'shipping_type' => ['required'],
|
||||
'customer_id' => ['required', 'exists:customers,id'],
|
||||
'courier' => ['nullable'],
|
||||
'contact' => ['nullable'],
|
||||
'account_title' => ['nullable'],
|
||||
'account_username' => ['nullable'],
|
||||
'account_password' => ['nullable'],
|
||||
'info_needed' => ['nullable'],
|
||||
'notify' => ['nullable'],
|
||||
'notes' => ['nullable'],
|
||||
];
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Contact extends Model
|
||||
{
|
||||
use SoftDeletes, HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'customer_id',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'email',
|
||||
'phone',
|
||||
'notes',
|
||||
];
|
||||
|
||||
public function customer(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Customer::class);
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class PackingSlip extends Model
|
||||
{
|
||||
use SoftDeletes, HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'order_id',
|
||||
'customer_id',
|
||||
'date_received',
|
||||
'amount',
|
||||
'contents',
|
||||
];
|
||||
|
||||
public function customer(): BelongsTo {
|
||||
return $this->belongsTo(Customer::class);
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\ShippingType;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class ShippingEntry extends Model
|
||||
{
|
||||
use SoftDeletes, HasFactory;
|
||||
|
||||
protected $casts = [
|
||||
'shipping_type' => ShippingType::class
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'shipping_type',
|
||||
'customer_id',
|
||||
'courier',
|
||||
'contact',
|
||||
'account_title',
|
||||
'account_username',
|
||||
'account_password',
|
||||
'info_needed',
|
||||
'notify',
|
||||
'notes',
|
||||
];
|
||||
|
||||
public function customer(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Customer::class);
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Contact;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class ContactFactory extends Factory
|
||||
{
|
||||
protected $model = Contact::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
$first_name = $this->faker->firstName();
|
||||
$last_name = $this->faker->lastName();
|
||||
$email = strtolower($first_name . '.' . $last_name) . '@example.com';
|
||||
|
||||
return [
|
||||
'first_name' => $first_name,
|
||||
'last_name' => $last_name,
|
||||
'email' => $email,
|
||||
'phone' => $this->faker->phoneNumber(),
|
||||
'created_at' => Carbon::now(),
|
||||
'updated_at' => Carbon::now(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\PackingSlip;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class PackingSlipFactory extends Factory
|
||||
{
|
||||
protected $model = PackingSlip::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'date_received' => $this->faker->dateTimeBetween('-1 month', 'now'),
|
||||
'order_id' => $this->faker->randomNumber(6),
|
||||
'amount' => $this->faker->numberBetween(2, 5) . ' boxes',
|
||||
'contents' => $this->faker->numberBetween(2, 60) . ' ' . $this->faker->randomElement(['t-shirts', 'caps', 'jackets', 'pants', 'sweaters']),
|
||||
'created_at' => Carbon::now(),
|
||||
'updated_at' => Carbon::now(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Customer;
|
||||
use App\Models\ShippingEntry;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class ShippingEntryFactory extends Factory
|
||||
{
|
||||
protected $model = ShippingEntry::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => Carbon::now(),
|
||||
'updated_at' => Carbon::now(),
|
||||
'courier' => $this->faker->randomElement(['UPS', 'Purolator', 'FreightCom', 'E-Shipper', 'ACE']),
|
||||
'contact' => $this->faker->randomElement(['courier.com', '+1 604 123 4567']),
|
||||
'account_title' => $this->faker->word,
|
||||
'account_username' => 'username',
|
||||
'account_password' => 'password',
|
||||
'info_needed' => $this->faker->words(3,true),
|
||||
'notify' => 'someone@account.com',
|
||||
'notes' => $this->faker->randomElement(['', '', '', 'Some really long text to simulate a note being put here']),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('contacts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('customer_id')->constrained();
|
||||
|
||||
$table->string('first_name')->nullable();
|
||||
$table->string('last_name')->nullable();
|
||||
$table->string('email')->nullable();
|
||||
$table->string('phone')->nullable();
|
||||
$table->string('notes')->nullable();
|
||||
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('contacts');
|
||||
}
|
||||
};
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('packing_slips', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
// $table->foreignId('order_id')->nullable()->constrained();
|
||||
$table->string('order_id')->nullable(); //todo: replace this once orders are actually in da system
|
||||
$table->foreignId('customer_id')->nullable()->constrained();
|
||||
$table->date('date_received');
|
||||
$table->string('amount');
|
||||
$table->string('contents');
|
||||
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('packing_slips');
|
||||
}
|
||||
};
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('shipping_entries', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->enum('shipping_type', ['Pickup', 'We ship', 'They ship']);
|
||||
$table->foreignId('customer_id')->constrained('customers');
|
||||
$table->string('courier')->nullable();
|
||||
$table->string('contact')->nullable();
|
||||
$table->string('account_title')->nullable();
|
||||
$table->string('account_username')->nullable();
|
||||
$table->string('account_password')->nullable();
|
||||
$table->string('info_needed')->nullable();
|
||||
$table->string('notify')->nullable();
|
||||
$table->string('notes')->nullable();
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('shipping_entries');
|
||||
}
|
||||
};
|
@ -1 +1,2 @@
|
||||
import './bootstrap';
|
||||
import 'bootstrap';
|
||||
|
@ -0,0 +1,142 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('header')
|
||||
<div class="container-fluid bg-light pt-3">
|
||||
|
||||
<!-- Customer company name row -->
|
||||
<div class="row justify-content-center pb-2">
|
||||
<div class="col-3"></div>
|
||||
<div class="col">
|
||||
<h2></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tabs row -->
|
||||
<div class="row justify-content-center mb-3">
|
||||
<div class="col-3 border-bottom"></div>
|
||||
<div class="col-6 p-0">
|
||||
|
||||
<ul class="nav nav-fill nav-tabs" id="customer-tabs" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link link-dark {{$tab == null ? 'active' : ''}}" id="details-tab"
|
||||
data-bs-toggle="tab" data-bs-target="#details" type="button" role="tab"
|
||||
aria-controls="details" aria-selected="{{$tab == null ? 'true' : 'false'}}">
|
||||
<x-bi-list-ul/>
|
||||
Customers
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link link-dark {{$tab == 'shipping' ? 'active' : ''}}" id="shipping-tab"
|
||||
data-bs-toggle="tab" data-bs-target="#shipping" type="button" role="tab"
|
||||
aria-controls="shipping" aria-selected="{{$tab == 'shipping' ? 'true' : 'false'}}">
|
||||
<x-bi-box-fill/>
|
||||
Orders
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link link-dark {{$tab == 'packing' ? 'active' : ''}}" id="packing-tab"
|
||||
data-bs-toggle="tab" data-bs-target="#packing" type="button" role="tab"
|
||||
aria-controls="packing" aria-selected="{{$tab == 'packing' ? 'true' : 'false'}}">
|
||||
<x-bi-card-text/>
|
||||
Packing Slips
|
||||
</button>
|
||||
</li>
|
||||
{{-- <li class="nav-item" role="presentation">--}}
|
||||
{{-- <button class="nav-link link-dark {{$tab == 'contacts' ? 'active' : ''}}" id="contacts-tab"--}}
|
||||
{{-- data-bs-toggle="tab" data-bs-target="#contacts" type="button" role="tab"--}}
|
||||
{{-- aria-controls="contacts" aria-selected="{{$tab == 'contacts' ? 'true' : 'false'}}">--}}
|
||||
{{-- <x-bi-people-fill/>--}}
|
||||
{{-- Contacts--}}
|
||||
{{-- </button>--}}
|
||||
{{-- </li>--}}
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="col border-bottom"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection()
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center mb-3">
|
||||
<div class="col">
|
||||
<div class="d-flex flex-row gap-2">
|
||||
<button class="btn btn-primary" title="Create new customer..."
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#createCustomerModal">
|
||||
<x-bi-person-plus-fill/>
|
||||
Create entry
|
||||
</button>
|
||||
|
||||
<div class="vr"></div>
|
||||
|
||||
<div class="d-inline-flex gap-2">
|
||||
<input type="text" class="form-control" placeholder="Search..."
|
||||
name="" id="">
|
||||
<button class="btn btn-outline-primary">
|
||||
<x-bi-search/>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="mx-auto"></div>
|
||||
|
||||
<button class="btn btn-danger" title="Delete customer..."
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#deleteCustomerModal">
|
||||
<x-bi-trash-fill/>
|
||||
Delete entry
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col">
|
||||
@if(sizeof($customers) !== 0)
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr class="border-bottom border-black">
|
||||
<th scope="col">Company Name</th>
|
||||
<th scope="col">Internal Name</th>
|
||||
<th scope="col">Shipping Address</th>
|
||||
<th scope="col">Billing Address</th>
|
||||
<th scope="col">Phone</th>
|
||||
<th scope="col">View</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
@foreach($customers as $customer)
|
||||
<tr>
|
||||
<td> {{$customer->company_name}} </td>
|
||||
<td><code>{{$customer->internal_name}}</code></td>
|
||||
<td> {{$customer->shipping_address}} </td>
|
||||
<td> {{$customer->billing_address}} </td>
|
||||
<td class="text-nowrap"> {{$customer->phone}} </td>
|
||||
<td class="align-top"><a class="btn btn-sm btn-outline-secondary"
|
||||
href="{{route('customers.show', [$customer->id, 'tab'=>'details'])}}">
|
||||
<x-bi-arrow-right/>
|
||||
</a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@else()
|
||||
No customer data.
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Create Customer Modal -->
|
||||
@include('partials.customers.create-modal')
|
||||
|
||||
<!-- Delete Customer Modal -->
|
||||
@include('partials.customers.delete-all-modal')
|
||||
|
||||
@endsection
|
@ -0,0 +1,123 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('header')
|
||||
<div class="container-fluid bg-light pt-3">
|
||||
|
||||
<!-- Customer company name row -->
|
||||
<div class="row justify-content-center pb-2">
|
||||
<div class="col-3"></div>
|
||||
<div class="col">
|
||||
<h2>{{$customer->company_name}}</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tabs row -->
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-3 border-bottom"></div>
|
||||
<div class="col-6 p-0">
|
||||
|
||||
<ul class="nav nav-fill nav-tabs" id="customer-tabs" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link link-dark {{$tab == 'details' ? 'active' : ''}}" id="details-tab"
|
||||
href="{{route('customers.show', [$customer, 'tab'=>'details'])}}" type="button"
|
||||
role="tab"
|
||||
aria-controls="details" aria-selected="{{$tab == 'details' ? 'true' : 'false'}}">
|
||||
<x-bi-list-ul/>
|
||||
Overview
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link link-dark {{$tab == 'shipping' ? 'active' : ''}}" id="shipping-tab"
|
||||
href="{{route('customers.show', [$customer, 'tab'=>'shipping'])}}" type="button"
|
||||
role="tab"
|
||||
aria-controls="shipping" aria-selected="{{$tab == 'shipping' ? 'true' : 'false'}}">
|
||||
<x-bi-box-fill/>
|
||||
Shipping Info
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link link-dark {{$tab == 'packing' ? 'active' : ''}}" id="packing-tab"
|
||||
href="{{route('customers.show', [$customer, 'tab'=>'packing'])}}" type="button"
|
||||
role="tab"
|
||||
aria-controls="packing" aria-selected="{{$tab == 'packing' ? 'true' : 'false'}}">
|
||||
<x-bi-card-text/>
|
||||
Packing Slips
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link link-dark {{$tab == 'contacts' ? 'active' : ''}}" id="contacts-tab"
|
||||
href="{{route('customers.show', [$customer, 'tab'=>'contacts'])}}" type="button"
|
||||
role="tab"
|
||||
aria-controls="contacts" aria-selected="{{$tab == 'contacts' ? 'true' : 'false'}}">
|
||||
<x-bi-people-fill/>
|
||||
Contacts
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="col border-bottom"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center my-3">
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<!-- Overview tab -->
|
||||
<div class="tab-pane {{$tab == 'details' ? 'active' : ''}}" id="details" role="tabpanel"
|
||||
aria-labelledby="details-tab">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-9">
|
||||
- email etc <br>
|
||||
- also known by <br>
|
||||
- active orders
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Shipping Info tab -->
|
||||
@include('partials.customers.show-shipping-info')
|
||||
|
||||
<!-- Packing Slips tab -->
|
||||
@include('partials.customers.show-packing-slips')
|
||||
|
||||
<!-- Contacts tab -->
|
||||
@include('partials.customers.show-contacts')
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- @if($errors->any())--}}
|
||||
{{-- {{ implode('', $errors->all('<div>:message</div>')) }}--}}
|
||||
{{-- @endif--}}
|
||||
|
||||
<!-- Edit Customer Modal -->
|
||||
@include('partials.customers.edit-modal')
|
||||
|
||||
<!-- Delete Customer Modal -->
|
||||
@include('partials.customers.delete-single-modal')
|
||||
|
||||
<!-- Create Contact Modal -->
|
||||
@include('partials.contacts.create-modal')
|
||||
|
||||
<!-- Delete Contact Modal -->
|
||||
@include('partials.contacts.delete-modal')
|
||||
|
||||
<!-- Create Packing Slip Modal -->
|
||||
@include('partials.packing-slips.create-modal')
|
||||
|
||||
<!-- Create Shipping Entry Modal -->
|
||||
@include('partials.shipping-entries.create-modal')
|
||||
|
||||
|
||||
@if($errors->any())
|
||||
{{ implode('', $errors->all('<div>:message</div>')) }}
|
||||
@endif
|
||||
|
||||
@endsection
|
@ -0,0 +1,118 @@
|
||||
<div class="modal modal-lg fade" id="createContactModal" tabindex="-1" aria-labelledby="createContactModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="createContactModalLabel">Create Contact</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<form action="{{route('contacts.store')}}" method="post">
|
||||
<div class="modal-body">
|
||||
@csrf
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="customer_id" class="col-md-4 col-form-label text-md-end">Customer</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input type="hidden" name="customer_id" value="{{$customer->id}}">
|
||||
<select name="customer_id" id="customer_id" class="form-select" disabled>
|
||||
<option value="{{ $customer->id }}">
|
||||
{{ $customer->company_name }}
|
||||
</option>
|
||||
</select>
|
||||
@error('customer_id')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="first_name" class="col-md-4 col-form-label text-md-end">First name</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="first_name" type="text"
|
||||
class="form-control @error('first_name') is-invalid @enderror"
|
||||
name="first_name" value="{{ old('first_name') }}"
|
||||
autocomplete="first_name" autofocus>
|
||||
|
||||
@error('first_name')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="last_name" class="col-md-4 col-form-label text-md-end">Last name</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="last_name" type="text"
|
||||
class="form-control @error('last_name') is-invalid @enderror"
|
||||
name="last_name" value="{{ old('last_name') }}"
|
||||
autocomplete="last_name">
|
||||
|
||||
@error('last_name')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="email" class="col-md-4 col-form-label text-md-end">Email</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="email" type="text"
|
||||
class="form-control @error('email') is-invalid @enderror" name="email"
|
||||
value="{{ old('email') }}" autocomplete="email">
|
||||
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="phone" class="col-md-4 col-form-label text-md-end">Phone number</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="phone" type="text"
|
||||
class="form-control @error('phone') is-invalid @enderror" name="phone"
|
||||
value="{{ old('phone') }}" autocomplete="phone">
|
||||
|
||||
@error('phone')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="notes" class="col-md-4 col-form-label text-md-end">Notes</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<textarea name="notes" id="notes" cols="30" rows="3" class="form-control"
|
||||
autocomplete="notes">{{ old('notes') }}</textarea>
|
||||
@error('notes')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Create contact</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,31 @@
|
||||
<div class="modal modal fade" id="deleteContactModal" tabindex="-1" aria-labelledby="deleteContactModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="deleteContactModalLabel">Delete Contact</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<form action="{{route('contacts.requestDestroy')}}" method="post">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
@if(sizeof($contacts) !== 0)
|
||||
<select name="contact" id="contact" class="form-select">
|
||||
@foreach($contacts as $contact)
|
||||
<option value="{{ $contact->id }}"> {{ $contact->first_name . ' ' . $contact->last_name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@else
|
||||
There are no contacts to delete.
|
||||
@endif
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
@if (sizeof($contacts) !== 0)
|
||||
<button type="submit" class="btn btn-danger">Delete contact</button>
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,111 @@
|
||||
<div class="modal modal-lg fade" id="createCustomerModal" tabindex="-1" aria-labelledby="createCustomerModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="createCustomerModalLabel">Create Customer</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
|
||||
<form action="{{route('customers.store')}}" method="post">
|
||||
<div class="modal-body">
|
||||
@csrf
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="company_name" class="col-md-4 col-form-label text-md-end">Company Name</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="company_name" type="text"
|
||||
class="form-control @error('company_name') is-invalid @enderror"
|
||||
name="company_name" value="{{ old('company_name') }}" required
|
||||
autocomplete="company_name"
|
||||
autofocus>
|
||||
|
||||
@error('company_name')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="internal_name" class="col-md-4 col-form-label text-md-end">Internal Name</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="internal_name" type="text"
|
||||
class="form-control @error('internal_name') is-invalid @enderror"
|
||||
name="internal_name" value="{{ old('internal_name') }}" required
|
||||
autocomplete="internal_name"
|
||||
>
|
||||
|
||||
@error('internal_name')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="shipping_address" class="col-md-4 col-form-label text-md-end">Shipping
|
||||
Address</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="shipping_address" type="text"
|
||||
class="form-control @error('shipping_address') is-invalid @enderror"
|
||||
name="shipping_address"
|
||||
value="{{ old('shipping_address') }}" required autocomplete="shipping_address"
|
||||
>
|
||||
|
||||
@error('shipping_address')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="billing_address" class="col-md-4 col-form-label text-md-end">Billing Address</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="billing_address" type="text"
|
||||
class="form-control @error('billing_address') is-invalid @enderror"
|
||||
name="billing_address" value="{{ old('billing_address') }}" required
|
||||
autocomplete="billing_address"
|
||||
>
|
||||
|
||||
@error('billing_address')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="phone" class="col-md-4 col-form-label text-md-end">Phone number</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="phone" type="text" class="form-control @error('phone') is-invalid @enderror"
|
||||
name="phone"
|
||||
value="{{ old('phone') }}" required autocomplete="phone" >
|
||||
|
||||
@error('phone')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Create customer</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,31 @@
|
||||
<div class="modal modal fade" id="deleteCustomerModal" tabindex="-1" aria-labelledby="deleteCustomerModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="deleteCustomerModalLabel">Delete Customer</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<form action="{{route('customers.requestDestroy')}}" method="post">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
@if(sizeof($customers) !== 0)
|
||||
<select name="id" id="id" class="form-select">
|
||||
@foreach($customers as $customer)
|
||||
<option value="{{ $customer->id }}"> {{ $customer->company_name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@else
|
||||
There are no customers to delete.
|
||||
@endif
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
@if (sizeof($customers) !== 0)
|
||||
<button type="submit" class="btn btn-danger">Delete customer</button>
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,23 @@
|
||||
<div class="modal modal fade" id="deleteCustomerModal" tabindex="-1" aria-labelledby="deleteCustomerModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="deleteCustomerModalLabel">Delete Customer</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<form action="{{route('customers.destroy', $customer->id)}}" method="post">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
|
||||
<div class="modal-body">
|
||||
Are you sure you want to delete {{$customer->company_name}}?
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-danger">Delete customer</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,110 @@
|
||||
<div class="modal modal-lg fade" id="editCustomerModal" tabindex="-1" aria-labelledby="editCustomerModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="editCustomerModalLabel">Edit Customer</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
|
||||
<form action="{{route('customers.update', $customer)}}" method="post">
|
||||
@csrf
|
||||
@method('PATCH')
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="company_name" class="col-md-4 col-form-label text-md-end">Company Name</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="company_name" type="text"
|
||||
class="form-control @error('company_name') is-invalid @enderror"
|
||||
name="company_name" value="{{$customer->company_name}}" required
|
||||
autocomplete="company_name" autofocus>
|
||||
|
||||
@error('company_name')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="internal_name" class="col-md-4 col-form-label text-md-end">Internal Name</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="internal_name" type="text"
|
||||
class="form-control @error('internal_name') is-invalid @enderror"
|
||||
name="internal_name" value="{{ $customer->internal_name }}" required
|
||||
autocomplete="internal_name"
|
||||
>
|
||||
|
||||
@error('internal_name')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="shipping_address" class="col-md-4 col-form-label text-md-end">
|
||||
Shipping Address
|
||||
</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="shipping_address" type="text"
|
||||
class="form-control @error('shipping_address') is-invalid @enderror"
|
||||
name="shipping_address" value="{{ $customer->shipping_address }}" required
|
||||
autocomplete="shipping_address">
|
||||
|
||||
@error('shipping_address')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="billing_address" class="col-md-4 col-form-label text-md-end">Billing Address</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="billing_address" type="text"
|
||||
class="form-control @error('billing_address') is-invalid @enderror"
|
||||
name="billing_address" value="{{ $customer->billing_address }}" required
|
||||
autocomplete="billing_address" >
|
||||
|
||||
@error('billing_address')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="phone" class="col-md-4 col-form-label text-md-end">Phone number</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="phone" type="text" class="form-control @error('phone') is-invalid @enderror"
|
||||
name="phone" value="{{ $customer->phone }}" required autocomplete="phone">
|
||||
|
||||
@error('phone')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Edit customer</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,52 @@
|
||||
<div class="tab-pane {{$tab == 'contacts' ? 'active' : ''}}" id="contacts" role="tabpanel"
|
||||
aria-labelledby="contacts-tab">
|
||||
<div class="row justify-content-center mb-3">
|
||||
<div class="col-9">
|
||||
<div class="d-flex flex-row-reverse gap-2">
|
||||
{{-- <button class="btn btn-sm btn-danger" title="Remove a contact..."--}}
|
||||
{{-- data-bs-toggle="modal" data-bs-target="#deleteContactModal">--}}
|
||||
{{-- <x-bi-trash-fill/>--}}
|
||||
{{-- Delete contact--}}
|
||||
{{-- </button>--}}
|
||||
|
||||
<div class="mx-auto"></div>
|
||||
|
||||
<button class="btn btn-sm btn-primary" title="Create new contact..."
|
||||
data-bs-toggle="modal" data-bs-target="#createContactModal">
|
||||
<x-bi-person-plus-fill/>
|
||||
New contact
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(sizeof($contacts) !== 0)
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-9">
|
||||
<table class="table table-hover table-striped">
|
||||
<thead>
|
||||
<tr class="border-bottom border-black">
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Email</th>
|
||||
<th scope="col">Phone</th>
|
||||
<th scope="col">Notes</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($contacts as $contact)
|
||||
<tr>
|
||||
<td>{{ $contact->first_name . ' ' . $contact->last_name }}</td>
|
||||
<td><a href="mailto:{{$contact->email}}">{{ $contact->email }}</a></td>
|
||||
<td>{{ $contact->phone }}</td>
|
||||
<td>{{ $contact->notes }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@else()
|
||||
No contacts registered for this customer.
|
||||
@endif()
|
||||
</div>
|
@ -0,0 +1,66 @@
|
||||
<div class="tab-pane {{$tab == 'packing' ? 'active' : ''}}" id="packing" role="tabpanel"
|
||||
aria-labelledby="packing-tab">
|
||||
<div class="row justify-content-center mb-3">
|
||||
<div class="col-9">
|
||||
<div class="d-flex flex-row gap-2">
|
||||
{{-- <button class="btn btn-sm btn-danger" title="Remove a contact..."--}}
|
||||
{{-- data-bs-toggle="modal" data-bs-target="#deleteContactModal">--}}
|
||||
{{-- <x-bi-trash-fill/>--}}
|
||||
{{-- Delete entry--}}
|
||||
{{-- </button>--}}
|
||||
|
||||
<button class="btn btn-sm btn-primary" title="Create new packing slip..."
|
||||
data-bs-toggle="modal" data-bs-target="#createPackingSlipModal">
|
||||
<x-bi-plus-circle-fill/>
|
||||
Create entry
|
||||
</button>
|
||||
|
||||
<div class="mx-auto"></div>
|
||||
|
||||
{{-- <div class="vr"></div>--}}
|
||||
|
||||
<div class="d-inline-flex gap-2">
|
||||
<input type="text" class="form-control form-control-sm" placeholder="Search..."
|
||||
name="" id="searchText">
|
||||
<button class="btn btn-sm btn-outline-primary" id="searchButton">
|
||||
<x-bi-search/>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center mb-3">
|
||||
<div class="col-9">
|
||||
<table class="table table-striped table-sm table-hover">
|
||||
<thead>
|
||||
<tr class="border-bottom border-black">
|
||||
<th scope="col">Date</th>
|
||||
<th scope="col">PO</th>
|
||||
<th scope="col">Amount</th>
|
||||
<th scope="col">Contents</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($packingSlips as $packingSlip)
|
||||
<tr>
|
||||
<td>{{$packingSlip->date_received}}</td>
|
||||
<td><a href="">{{$packingSlip->order_id}}</a></td>
|
||||
<td>{{$packingSlip->amount}}</td>
|
||||
<td>{{$packingSlip->contents}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col"></div>
|
||||
<div class="col-4">
|
||||
{{$packingSlips->links()}}
|
||||
</div>
|
||||
<div class="col"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
@ -0,0 +1,99 @@
|
||||
<div class="tab-pane {{$tab == 'shipping' ? 'active' : ''}}" id="shipping" role="tabpanel"
|
||||
aria-labelledby="shipping-tab">
|
||||
<div class="row justify-content-center mb-3">
|
||||
<div class="col-9">
|
||||
<div class="d-flex flex-row gap-2">
|
||||
<button class="btn btn-sm btn-primary" title="Create new shipping entry..."
|
||||
data-bs-toggle="modal" data-bs-target="#createShippingEntryModal">
|
||||
<x-bi-plus-circle-fill/>
|
||||
Create entry
|
||||
</button>
|
||||
|
||||
<div class="mx-auto"></div>
|
||||
|
||||
<div class="d-inline-flex gap-2">
|
||||
<input type="text" class="form-control form-control-sm" placeholder="Search..."
|
||||
name="" id="searchText">
|
||||
<button class="btn btn-sm btn-outline-primary" id="searchButton">
|
||||
<x-bi-search/>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center mb-3">
|
||||
@foreach($shippingEntries as $shippingEntry)
|
||||
<div class="col-4">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
{{$shippingEntry->account_title}}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-md-end text-secondary">Shipping Type</div>
|
||||
<div class="col-md-6">
|
||||
<div class="">{{$shippingEntry->shipping_type}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="border-secondary-subtle mx-4 px-0">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-md-end text-secondary">Courier</div>
|
||||
<div class="col-md-6">
|
||||
<div class="fw-bold">{{$shippingEntry->courier}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-md-end text-secondary">Contact</div>
|
||||
<div class="col-md-6">
|
||||
<div class="text-nowrap">
|
||||
<a href="">{{$shippingEntry->contact}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-md-end text-secondary">Login</div>
|
||||
<div class="col-md-6">
|
||||
<div class="fw-bold">
|
||||
{{$shippingEntry->account_username}} <br>
|
||||
<code>{{$shippingEntry->account_password}}</code>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="border-secondary-subtle mx-4 px-0">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-md-end text-secondary text-nowrap">Required Info
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="">{{$shippingEntry->info_needed}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-md-end text-secondary">Notify</div>
|
||||
<div class="col-md-6">
|
||||
<div class="text-nowrap"><a
|
||||
href="mailto:">{{$shippingEntry->notify}}</a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-md-end text-secondary">Notes</div>
|
||||
<div class="col-md-6">
|
||||
<div class="">{{$shippingEntry->notes}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,114 @@
|
||||
<div class="modal modal-lg fade" id="createPackingSlipModal" tabindex="-1" aria-labelledby="createPackingSlipModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="createPackingSlipModalLabel">Create Packing Slip</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
|
||||
<form action="{{route('packing-slips.store')}}" method="post">
|
||||
@csrf
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="row mb-3">
|
||||
<label for="date_received" class="col-md-4 col-form-label text-md-end">Date received</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="date_received" type="date"
|
||||
class="form-control @error('date_received') is-invalid @enderror"
|
||||
name="date_received" value="{{ old('date_received') ?? $today }}" required
|
||||
autocomplete="date_received" max="{{$today}}"
|
||||
autofocus>
|
||||
|
||||
@error('date_received')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="customer_id" class="col-md-4 col-form-label text-md-end">Customer</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input type="hidden" name="from_customer" value="0">
|
||||
|
||||
@if(isset($customer))
|
||||
<input type="hidden" name="customer_id" value="{{$customer->id}}">
|
||||
<input type="hidden" name="from_customer" value="1">
|
||||
|
||||
<select name="customer_id" id="customer_id" class="form-select" disabled>
|
||||
<option value="{{ $customer->id }}">
|
||||
{{ $customer->company_name }}
|
||||
</option>
|
||||
</select>
|
||||
@endif
|
||||
@error('customer_id')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="order_id" class="col-md-4 col-form-label text-md-end">Product Order</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="order_id" type="text"
|
||||
class="form-control @error('order_id') is-invalid @enderror"
|
||||
name="order_id" value="{{ old('order_id') }}"
|
||||
autocomplete="order_id">
|
||||
|
||||
@error('order_id')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="amount"
|
||||
class="col-md-4 col-form-label text-md-end">Amount</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="amount" type="text"
|
||||
class="form-control @error('amount') is-invalid @enderror"
|
||||
name="amount" placeholder="For example: 2 boxes"
|
||||
value="{{ old('amount') }}" required autocomplete="amount">
|
||||
|
||||
@error('amount')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="contents" class="col-md-4 col-form-label text-md-end">Contents</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<textarea name="contents" id="contents" cols="30" rows="3" class="form-control"
|
||||
autocomplete="contents" placeholder="For example: 30 shirts, 25 jackets"
|
||||
required>{{ old('contents') }}</textarea>
|
||||
@error('contents')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Create</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,128 @@
|
||||
<div class="modal modal-lg fade" id="createShippingEntryModal" tabindex="-1"
|
||||
aria-labelledby="createShippingEntryModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="createShippingEntryModalLabel">Create Shipping Entry</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"
|
||||
tabindex="-1"></button>
|
||||
</div>
|
||||
|
||||
<form action="{{route('shipping-entries.store')}}" method="post">
|
||||
@csrf
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
@if (isset($customer))
|
||||
<input type="hidden" name="customer_id" value="{{$customer->id}}">
|
||||
@endif
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="shipping_type" class="col-md-4 col-form-label text-md-end">Ship Type</label>
|
||||
<div class="col-md-6">
|
||||
<select name="shipping_type" class="form-select" id="shipping_type" autofocus>
|
||||
<option value="pickup">Pick-up</option>
|
||||
<option value="they-ship">They ship</option>
|
||||
<option value="we-ship">We ship</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="account_title" class="col-md-4 col-form-label text-md-end">Entry Title</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="account_title" type="text"
|
||||
class="form-control @error('account_title') is-invalid @enderror"
|
||||
name="account_title" value="{{ old('account_name') }}"
|
||||
autocomplete="account_title">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="border-secondary-subtle mx-4 px-0">
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="courier" class="col-md-4 col-form-label text-md-end">Courier</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="courier" type="text"
|
||||
class="form-control @error('courier') is-invalid @enderror"
|
||||
name="courier" value="{{ old('courier') }}"
|
||||
autocomplete="courier">
|
||||
|
||||
{{-- @error('order_id')--}}
|
||||
{{-- <span class="invalid-feedback" role="alert">--}}
|
||||
{{-- <strong>{{ $message }}</strong>--}}
|
||||
{{-- </span>--}}
|
||||
{{-- @enderror--}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="contact" class="col-md-4 col-form-label text-md-end">Contact</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="contact" type="text"
|
||||
class="form-control @error('contact') is-invalid @enderror"
|
||||
name="contact" value="{{ old('contact') }}"
|
||||
autocomplete="contact" placeholder="Website link or phone number">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="border-secondary-subtle mx-4 px-0">
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="account_username" class="col-md-4 col-form-label text-md-end">Username</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="account_username" type="text"
|
||||
class="form-control @error('account_username') is-invalid @enderror"
|
||||
name="account_username" value="{{ old('account_username') }}"
|
||||
autocomplete="account_username">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="account_password" class="col-md-4 col-form-label text-md-end">Password</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="account_password" type="text"
|
||||
class="form-control @error('account_password') is-invalid @enderror"
|
||||
name="account_password" value="{{ old('password') }}"
|
||||
autocomplete="account_password">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="border-secondary-subtle mx-4 px-0">
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="info_needed" class="col-md-4 col-form-label text-md-end">Required Info</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<textarea name="info_needed" id="info_needed" cols="30" rows="2"
|
||||
class="form-control"
|
||||
autocomplete="info_needed">{{ old('info_needed') }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="notes" class="col-md-4 col-form-label text-md-end">Notes</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<textarea name="notes" id="notes" cols="30" rows="3"
|
||||
class="form-control"
|
||||
autocomplete="notes">{{ old('notes') }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Create</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -0,0 +1,46 @@
|
||||
@if ($paginator->hasPages())
|
||||
<nav>
|
||||
<ul class="pagination">
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')">
|
||||
<span class="page-link" aria-hidden="true">‹</span>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')">‹</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
{{-- Pagination Elements --}}
|
||||
@foreach ($elements as $element)
|
||||
{{-- "Three Dots" Separator --}}
|
||||
@if (is_string($element))
|
||||
<li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li>
|
||||
@endif
|
||||
|
||||
{{-- Array Of Links --}}
|
||||
@if (is_array($element))
|
||||
@foreach ($element as $page => $url)
|
||||
@if ($page == $paginator->currentPage())
|
||||
<li class="page-item active" aria-current="page"><span class="page-link">{{ $page }}</span></li>
|
||||
@else
|
||||
<li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')">›</a>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')">
|
||||
<span class="page-link" aria-hidden="true">›</span>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</nav>
|
||||
@endif
|
@ -0,0 +1,88 @@
|
||||
@if ($paginator->hasPages())
|
||||
<nav class="d-flex justify-items-center justify-content-between">
|
||||
<div class="d-flex justify-content-between flex-fill d-sm-none">
|
||||
<ul class="pagination">
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="page-item disabled" aria-disabled="true">
|
||||
<span class="page-link">@lang('pagination.previous')</span>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">@lang('pagination.previous')</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">@lang('pagination.next')</a>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item disabled" aria-disabled="true">
|
||||
<span class="page-link">@lang('pagination.next')</span>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="d-none flex-sm-fill d-sm-flex align-items-sm-center justify-content-sm-between">
|
||||
<div>
|
||||
<p class="small text-muted">
|
||||
{!! __('Showing') !!}
|
||||
<span class="fw-semibold">{{ $paginator->firstItem() }}</span>
|
||||
{!! __('to') !!}
|
||||
<span class="fw-semibold">{{ $paginator->lastItem() }}</span>
|
||||
{!! __('of') !!}
|
||||
<span class="fw-semibold">{{ $paginator->total() }}</span>
|
||||
{!! __('results') !!}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ul class="pagination">
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')">
|
||||
<span class="page-link" aria-hidden="true">‹</span>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')">‹</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
{{-- Pagination Elements --}}
|
||||
@foreach ($elements as $element)
|
||||
{{-- "Three Dots" Separator --}}
|
||||
@if (is_string($element))
|
||||
<li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li>
|
||||
@endif
|
||||
|
||||
{{-- Array Of Links --}}
|
||||
@if (is_array($element))
|
||||
@foreach ($element as $page => $url)
|
||||
@if ($page == $paginator->currentPage())
|
||||
<li class="page-item active" aria-current="page"><span class="page-link">{{ $page }}</span></li>
|
||||
@else
|
||||
<li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')">›</a>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')">
|
||||
<span class="page-link" aria-hidden="true">›</span>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@endif
|
@ -0,0 +1,46 @@
|
||||
@if ($paginator->hasPages())
|
||||
<nav>
|
||||
<ul class="pagination">
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="disabled" aria-disabled="true" aria-label="@lang('pagination.previous')">
|
||||
<span aria-hidden="true">‹</span>
|
||||
</li>
|
||||
@else
|
||||
<li>
|
||||
<a href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')">‹</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
{{-- Pagination Elements --}}
|
||||
@foreach ($elements as $element)
|
||||
{{-- "Three Dots" Separator --}}
|
||||
@if (is_string($element))
|
||||
<li class="disabled" aria-disabled="true"><span>{{ $element }}</span></li>
|
||||
@endif
|
||||
|
||||
{{-- Array Of Links --}}
|
||||
@if (is_array($element))
|
||||
@foreach ($element as $page => $url)
|
||||
@if ($page == $paginator->currentPage())
|
||||
<li class="active" aria-current="page"><span>{{ $page }}</span></li>
|
||||
@else
|
||||
<li><a href="{{ $url }}">{{ $page }}</a></li>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<li>
|
||||
<a href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')">›</a>
|
||||
</li>
|
||||
@else
|
||||
<li class="disabled" aria-disabled="true" aria-label="@lang('pagination.next')">
|
||||
<span aria-hidden="true">›</span>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</nav>
|
||||
@endif
|
@ -0,0 +1,36 @@
|
||||
@if ($paginator->hasPages())
|
||||
<div class="ui pagination menu" role="navigation">
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<a class="icon item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')"> <i class="left chevron icon"></i> </a>
|
||||
@else
|
||||
<a class="icon item" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')"> <i class="left chevron icon"></i> </a>
|
||||
@endif
|
||||
|
||||
{{-- Pagination Elements --}}
|
||||
@foreach ($elements as $element)
|
||||
{{-- "Three Dots" Separator --}}
|
||||
@if (is_string($element))
|
||||
<a class="icon item disabled" aria-disabled="true">{{ $element }}</a>
|
||||
@endif
|
||||
|
||||
{{-- Array Of Links --}}
|
||||
@if (is_array($element))
|
||||
@foreach ($element as $page => $url)
|
||||
@if ($page == $paginator->currentPage())
|
||||
<a class="item active" href="{{ $url }}" aria-current="page">{{ $page }}</a>
|
||||
@else
|
||||
<a class="item" href="{{ $url }}">{{ $page }}</a>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<a class="icon item" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')"> <i class="right chevron icon"></i> </a>
|
||||
@else
|
||||
<a class="icon item disabled" aria-disabled="true" aria-label="@lang('pagination.next')"> <i class="right chevron icon"></i> </a>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
@ -0,0 +1,27 @@
|
||||
@if ($paginator->hasPages())
|
||||
<nav>
|
||||
<ul class="pagination">
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="page-item disabled" aria-disabled="true">
|
||||
<span class="page-link">@lang('pagination.previous')</span>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">@lang('pagination.previous')</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">@lang('pagination.next')</a>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item disabled" aria-disabled="true">
|
||||
<span class="page-link">@lang('pagination.next')</span>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</nav>
|
||||
@endif
|
@ -0,0 +1,29 @@
|
||||
@if ($paginator->hasPages())
|
||||
<nav role="navigation" aria-label="Pagination Navigation">
|
||||
<ul class="pagination">
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="page-item disabled" aria-disabled="true">
|
||||
<span class="page-link">{!! __('pagination.previous') !!}</span>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">
|
||||
{!! __('pagination.previous') !!}
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">{!! __('pagination.next') !!}</a>
|
||||
</li>
|
||||
@else
|
||||
<li class="page-item disabled" aria-disabled="true">
|
||||
<span class="page-link">{!! __('pagination.next') !!}</span>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</nav>
|
||||
@endif
|
@ -0,0 +1,19 @@
|
||||
@if ($paginator->hasPages())
|
||||
<nav>
|
||||
<ul class="pagination">
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="disabled" aria-disabled="true"><span>@lang('pagination.previous')</span></li>
|
||||
@else
|
||||
<li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">@lang('pagination.previous')</a></li>
|
||||
@endif
|
||||
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<li><a href="{{ $paginator->nextPageUrl() }}" rel="next">@lang('pagination.next')</a></li>
|
||||
@else
|
||||
<li class="disabled" aria-disabled="true"><span>@lang('pagination.next')</span></li>
|
||||
@endif
|
||||
</ul>
|
||||
</nav>
|
||||
@endif
|
@ -0,0 +1,25 @@
|
||||
@if ($paginator->hasPages())
|
||||
<nav role="navigation" aria-label="Pagination Navigation" class="flex justify-between">
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md dark:text-gray-600 dark:bg-gray-800 dark:border-gray-600">
|
||||
{!! __('pagination.previous') !!}
|
||||
</span>
|
||||
@else
|
||||
<a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-300 dark:focus:border-blue-700 dark:active:bg-gray-700 dark:active:text-gray-300">
|
||||
{!! __('pagination.previous') !!}
|
||||
</a>
|
||||
@endif
|
||||
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<a href="{{ $paginator->nextPageUrl() }}" rel="next" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-300 dark:focus:border-blue-700 dark:active:bg-gray-700 dark:active:text-gray-300">
|
||||
{!! __('pagination.next') !!}
|
||||
</a>
|
||||
@else
|
||||
<span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md dark:text-gray-600 dark:bg-gray-800 dark:border-gray-600">
|
||||
{!! __('pagination.next') !!}
|
||||
</span>
|
||||
@endif
|
||||
</nav>
|
||||
@endif
|
@ -0,0 +1,106 @@
|
||||
@if ($paginator->hasPages())
|
||||
<nav role="navigation" aria-label="{{ __('Pagination Navigation') }}" class="flex items-center justify-between">
|
||||
<div class="flex justify-between flex-1 sm:hidden">
|
||||
@if ($paginator->onFirstPage())
|
||||
<span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md dark:text-gray-600 dark:bg-gray-800 dark:border-gray-600">
|
||||
{!! __('pagination.previous') !!}
|
||||
</span>
|
||||
@else
|
||||
<a href="{{ $paginator->previousPageUrl() }}" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-300 dark:focus:border-blue-700 dark:active:bg-gray-700 dark:active:text-gray-300">
|
||||
{!! __('pagination.previous') !!}
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if ($paginator->hasMorePages())
|
||||
<a href="{{ $paginator->nextPageUrl() }}" class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-300 dark:focus:border-blue-700 dark:active:bg-gray-700 dark:active:text-gray-300">
|
||||
{!! __('pagination.next') !!}
|
||||
</a>
|
||||
@else
|
||||
<span class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md dark:text-gray-600 dark:bg-gray-800 dark:border-gray-600">
|
||||
{!! __('pagination.next') !!}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<p class="text-sm text-gray-700 leading-5 dark:text-gray-400">
|
||||
{!! __('Showing') !!}
|
||||
@if ($paginator->firstItem())
|
||||
<span class="font-medium">{{ $paginator->firstItem() }}</span>
|
||||
{!! __('to') !!}
|
||||
<span class="font-medium">{{ $paginator->lastItem() }}</span>
|
||||
@else
|
||||
{{ $paginator->count() }}
|
||||
@endif
|
||||
{!! __('of') !!}
|
||||
<span class="font-medium">{{ $paginator->total() }}</span>
|
||||
{!! __('results') !!}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span class="relative z-0 inline-flex rtl:flex-row-reverse shadow-sm rounded-md">
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<span aria-disabled="true" aria-label="{{ __('pagination.previous') }}">
|
||||
<span class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-l-md leading-5 dark:bg-gray-800 dark:border-gray-600" aria-hidden="true">
|
||||
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
@else
|
||||
<a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-l-md leading-5 hover:text-gray-400 focus:z-10 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:active:bg-gray-700 dark:focus:border-blue-800" aria-label="{{ __('pagination.previous') }}">
|
||||
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
{{-- Pagination Elements --}}
|
||||
@foreach ($elements as $element)
|
||||
{{-- "Three Dots" Separator --}}
|
||||
@if (is_string($element))
|
||||
<span aria-disabled="true">
|
||||
<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 cursor-default leading-5 dark:bg-gray-800 dark:border-gray-600">{{ $element }}</span>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
{{-- Array Of Links --}}
|
||||
@if (is_array($element))
|
||||
@foreach ($element as $page => $url)
|
||||
@if ($page == $paginator->currentPage())
|
||||
<span aria-current="page">
|
||||
<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 dark:bg-gray-800 dark:border-gray-600">{{ $page }}</span>
|
||||
</span>
|
||||
@else
|
||||
<a href="{{ $url }}" class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 hover:text-gray-500 focus:z-10 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-400 dark:hover:text-gray-300 dark:active:bg-gray-700 dark:focus:border-blue-800" aria-label="{{ __('Go to page :page', ['page' => $page]) }}">
|
||||
{{ $page }}
|
||||
</a>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<a href="{{ $paginator->nextPageUrl() }}" rel="next" class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-r-md leading-5 hover:text-gray-400 focus:z-10 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:active:bg-gray-700 dark:focus:border-blue-800" aria-label="{{ __('pagination.next') }}">
|
||||
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</a>
|
||||
@else
|
||||
<span aria-disabled="true" aria-label="{{ __('pagination.next') }}">
|
||||
<span class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-r-md leading-5 dark:bg-gray-800 dark:border-gray-600" aria-hidden="true">
|
||||
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@endif
|
Loading…
Reference in New Issue