Merge pull request 'System basics' (#36) from re-design-orderproducts-create into main

Reviewed-on: #36
main
Nisse Lommerde 2 months ago
commit f0eba34776

@ -0,0 +1,11 @@
<?php
namespace App\Enums;
enum OrderStatus: string
{
case APPROVED = 'Approved';
case PRODUCTION = 'Production';
case SHIPPED = 'Shipped';
case INVOICED = 'Invoiced';
}

@ -0,0 +1,12 @@
<?php
namespace App\Enums;
enum OrderType: string
{
case EMBROIDERY = 'Embroidery';
case SCREEN = 'Screen printing';
case DTG = 'Direct-to-garment';
case VINYL = 'Vinyl';
case MISC = 'Misc';
}

@ -0,0 +1,10 @@
<?php
namespace App\Enums;
enum ShippingType: string
{
case THEY_SHIP = 'They ship';
case WE_SHIP = 'We ship';
case PICKUP = 'Pickup';
}

@ -43,14 +43,13 @@ class RegisterController extends Controller
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
]);
}
@ -58,14 +57,13 @@ class RegisterController extends Controller
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return \App\Models\User
*/
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
}

@ -0,0 +1,44 @@
<?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) {}
}

@ -4,42 +4,61 @@ namespace App\Http\Controllers;
use App\Http\Requests\CustomerRequest;
use App\Models\Customer;
use App\Models\PackingSlip;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
class CustomerController extends Controller
{
public function index()
{
return view('customer.index');
}
public function index() {}
public function store(CustomerRequest $request)
{
dd($request);
Customer::create($request->validated());
return Customer::create($request->validated());
return redirect()->route('management.index')->with('status', 'Customer created successfully.');
}
public function create()
{
return view('customer.create');
return view('customers.create');
}
public function show(Customer $customer)
public function show(Customer $customer, ?string $tab = null)
{
// return $customer;
if (! $tab) {
return redirect()->route('customers.show', [$customer, 'tab' => 'details']);
}
return view('customers.show', [
'tab' => $tab,
'customer' => $customer,
'contacts' => $customer->contacts()->get(),
'packingSlips' => PackingSlip::where('customer_id', $customer->id)->orderByDesc('date_received')->paginate(15),
'shippingEntries' => $customer->shippingEntries()->get(),
'today' => Carbon::today()->format('Y-m-d'),
]);
}
public function update(CustomerRequest $request, Customer $customer)
{
// $customer->update($request->validated());
$customer->update($request->validated());
return redirect()->route('customers.show', $customer)->with('status', 'Customer updated successfully.');
}
public function requestDestroy(Request $request)
{
$customer = Customer::find($request->id);
$customer->delete();
// return $customer;
return redirect()->route('management.index')->with('status', 'Customer deleted successfully.');
}
public function destroy(Customer $customer)
{
// $customer->delete();
$customer->delete();
// return response()->json();
return redirect()->route('management.index')->with('status', 'Customer deleted successfully.');
}
}

@ -0,0 +1,34 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
class DashboardController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*/
public function index(Request $request)
{
if (! $request->get('tab')) {
return redirect()->route('dashboard', ['tab' => 'active_orders']);
}
return view('dashboard', [
'today' => Carbon::today(),
'tab' => $request->get('tab'),
]);
}
}

@ -1,28 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
return view('home');
}
}

@ -0,0 +1,22 @@
<?php
namespace App\Http\Controllers;
use App\Models\Customer;
class ManagementController extends Controller
{
protected string $defaultTab = 'customers';
public function index(?string $tab = null)
{
if (! $tab) {
return redirect()->route('management.index', ['tab' => $this->defaultTab]);
}
return view('management.index', [
'customers' => Customer::all(),
'tab' => $tab,
]);
}
}

@ -0,0 +1,119 @@
<?php
namespace App\Http\Controllers;
use App\Enums\OrderStatus;
use App\Enums\OrderType;
use App\Http\Requests\OrderRequest;
use App\Models\Customer;
use App\Models\Order;
use App\Models\OrderProduct;
use App\Models\ProductService;
use App\Models\ProductSize;
use App\Models\ServiceFile;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
class OrderController extends Controller
{
public function index(Request $request)
{
if (! $request->get('tab')) {
return redirect()->route('orders.index', ['tab' => 'all']);
}
return view('orders.index', [
'tab' => $request->get('tab'),
]);
}
public function create()
{
return view('orders.create', [
'order_types' => OrderType::cases(),
'order_status' => OrderStatus::cases(),
'customers' => Customer::all(),
'today' => Carbon::today()->format('Y-m-d'),
'due_default' => Carbon::today()->addDay(10)->format('Y-m-d'),
]);
}
public function store(OrderRequest $request)
{
// Create order
$order = Order::create($request->safe()->only([
'customer_id',
'contact_id',
'order_type',
'status',
'customer_po',
'order_date',
'due_date',
'rush',
'new_art',
'digitizing',
'repeat',
'purchased_garments',
'customer_supplied_file',
'notes',
]));
// Create orderProducts
for ($i = 0; $i < count($request->get('productInputCount')) - 1; $i++) {
$orderProduct = OrderProduct::create([
'order_id' => $order->id,
'sku' => $request->get('sku')[$i],
'product_name' => $request->get('product_name')[$i],
'color' => $request->get('product_color')[$i],
]);
// Create productSizes
foreach (['xs', 's', 'm', 'l', 'xl', '2xl', '3xl', 'osfa'] as $size) {
ProductSize::create([
'order_product_id' => $orderProduct->id,
'amount' => $request->get('size_'.$size)[$i],
'size' => $size,
]);
}
}
// Create productServices
for ($i = 0; $i < count($request->get('serviceInputCount')) - 1; $i++) {
$productService = ProductService::create([
'order_id' => $order->id,
'service_type' => $request->get('service_type')[$i],
'placement' => $request->get('placement')[$i],
'setup_amount' => $request->get('setup_amount')[$i],
'amount' => $request->get('amount')[$i],
'amount_price' => $request->get('amount_price')[$i],
]);
ServiceFile::create([
'product_service_id' => $productService,
'code' => $request->get('service_file_name')[$i],
'name' => $request->get('logo_name')[$i],
'width' => $request->get('service_width')[$i],
'height' => $request->get('service_height')[$i],
'unit' => $request->get('service_setup_unit')[$i],
'setup_number' => $request->get('setup_number')[$i],
]);
}
return redirect()->route('order-products.create', ['order' => $order->id]);
}
public function show($id)
{
return view('orders.show', [
'order' => Order::find($id),
'tab' => 'details',
]);
}
public function edit($id) {}
public function update(Request $request, $id) {}
public function destroy($id) {}
}

@ -0,0 +1,25 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class OrderProductController extends Controller
{
public function index() {}
public function create()
{
return view('order-products.create');
}
public function store(Request $request) {}
public function show($id) {}
public function edit($id) {}
public function update(Request $request, $id) {}
public function destroy($id) {}
}

@ -0,0 +1,37 @@
<?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,29 @@
<?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;
}
}

@ -9,7 +9,11 @@ class CustomerRequest extends FormRequest
public function rules()
{
return [
'company_name' => 'required',
'internal_name' => 'required',
'shipping_address' => 'required',
'billing_address' => 'required',
'phone' => 'required',
];
}

@ -0,0 +1,23 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class OrderProductRequest extends FormRequest
{
public function rules(): array
{
return [
'order_id' => ['required', 'exists:orders'],
'sku' => ['string', 'nullable'],
'product_name' => ['required'],
'color' => ['string', 'nullable'],
];
}
public function authorize(): bool
{
return true;
}
}

@ -0,0 +1,33 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class OrderRequest extends FormRequest
{
public function rules(): array
{
return [
'customer_id' => ['required', 'exists:customers,id'],
'contact_id' => ['nullable', 'exists:contacts,id'],
'customer_po' => ['required', 'string'],
'order_type' => ['required', 'string'],
'order_date' => ['required', 'date'],
'due_date' => ['required', 'date'],
'status' => ['required'],
'rush' => ['nullable'],
'new_art' => ['nullable'],
'digitizing' => ['nullable'],
'repeat' => ['nullable'],
'purchased_garments' => ['nullable'],
'customer_supplied_file' => ['nullable'],
'notes' => ['nullable'],
];
}
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,26 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ProductServiceRequest extends FormRequest
{
public function rules(): array
{
return [
'order_product_id' => ['required', 'exists:order_products'],
'service_file_id' => ['nullable', 'exists:service_files'],
'service_type' => ['required'],
'placement' => ['required'],
'setup_amount' => ['required'],
'amount' => ['nullable'],
'amount_price' => ['nullable'],
];
}
public function authorize(): bool
{
return true;
}
}

@ -0,0 +1,22 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ProductSizeRequest extends FormRequest
{
public function rules(): array
{
return [
'order_product_id' => ['required', 'exists:order_products'],
'size' => ['required'],
'amount' => ['required'],
];
}
public function authorize(): bool
{
return true;
}
}

@ -0,0 +1,24 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ServiceFileRequest extends FormRequest
{
public function rules(): array
{
return [
'code' => ['required'],
'name' => ['required'],
'width' => ['required', 'numeric'],
'height' => ['required', 'numeric'],
'unit' => ['required'],
];
}
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,42 @@
<?php
namespace App\Livewire;
use App\Enums\OrderStatus;
use App\Enums\OrderType;
use App\Models\Customer;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Carbon;
use Livewire\Component;
class CreateOrder extends Component
{
public Collection $customers;
public string $selectedCustomer;
public $contacts;
public function mount(Collection $customers)
{
$this->customers = $customers;
$this->contacts = $customers->first()->contacts;
}
public function getContacts()
{
$this->contacts = Customer::find($this->selectedCustomer)->contacts;
}
public function render()
{
return view('livewire.create-order', [
'contacts' => $this->contacts,
'order_types' => OrderType::cases(),
'order_status' => OrderStatus::cases(),
'customers' => $this->customers,
'today' => Carbon::today()->format('Y-m-d'),
'due_default' => Carbon::today()->addDay(10)->format('Y-m-d'),
]);
}
}

@ -0,0 +1,41 @@
<?php
namespace App\Livewire;
use App\Models\Customer;
use Illuminate\Support\Collection;
use Livewire\Component;
class CustomerAndContactSelect extends Component
{
public Collection $customers;
public Collection $contacts;
public string $selectedCustomer;
public function mount(Collection $customers)
{
$this->customers = $customers;
if (isset($this->selectedCustomer)) {
$this->contacts = Customer::find($this->selectedCustomer)->contacts;
} else {
$this->contacts = $customers->first()->contacts;
}
}
public function updateContactList()
{
$this->contacts = Customer::find($this->selectedCustomer)->contacts;
}
public function render()
{
return view('livewire.customer-and-contact-select', [
'customers' => $this->customers,
'contacts' => $this->contacts,
]);
}
}

@ -0,0 +1,158 @@
<?php
namespace App\Livewire;
use Exception;
use Illuminate\Support\Collection;
use Livewire\Component;
class OrderProductsCreate extends Component
{
public Collection $productInputs;
public Collection $serviceInputs;
public array $sizes = [];
public array $totals = [];
public array $units = [];
public array $prices = [];
public array $priceTotals = [];
public int $totalQuantity = 0;
public string $totalPrice = '$0.00';
public function updated()
{
try {
foreach ($this->sizes as $index => $size) {
$this->totals[$index] = array_sum($size);
}
} catch (Exception $e) {
}
try {
foreach ($this->units as $index => $unit) {
$this->priceTotals[$index] = $unit * $this->prices[$index];
}
} catch (Exception $e) {
}
$this->totalQuantity = array_sum($this->totals);
$this->totalPrice = '$'.number_format(round(array_sum($this->priceTotals), 2), 2);
}
public function addProductInput()
{
$index = $this->productInputs->count();
$this->productInputs->push([
$index => [
'sku' => '',
'product_name' => '',
'product_color' => '',
'size_xs' => '',
'size_s' => '',
'size_m' => '',
'size_l' => '',
'size_xl' => '',
'size_2xl' => '',
'size_3xl' => '',
'size_osfa' => '',
'product_total' => '',
],
]);
}
public function determineAddProductRow($index)
{
if ($index == $this->productInputs->count() - 1) {
$this->addProductInput();
}
}
public function determineAddServiceProductRow($index)
{
if ($index == $this->serviceInputs->count() - 1) {
$this->addServiceInput();
}
}
public function removeProductInput($key)
{
if ($this->productInputs->count() > 1) {
$this->productInputs->pull($key);
}
}
public function addServiceInput()
{
$this->serviceInputs->push([
$this->serviceInputs->count() => [
'service_name' => '',
'product_name' => '',
'product_color' => '',
'logo_name' => '',
'setup_number' => '',
'service_width' => '',
'service_height' => '',
'service_setup_unit' => '',
'service_setup_price' => '',
'service_total' => '',
],
]);
}
public function removeServiceInput($key)
{
if ($this->serviceInputs->count() > 1) {
$this->serviceInputs->pull($key);
}
}
public function mount()
{
$this->fill([
'productInputs' => collect([
[
'sku' => '',
'product_name' => '',
'product_color' => '',
'size_xs' => '',
'size_s' => '',
'size_m' => '',
'size_l' => '',
'size_xl' => '',
'size_2xl' => '',
'size_3xl' => '',
'size_osfa' => '',
'product_total' => '0',
],
]),
'serviceInputs' => collect([
[
'sku' => '',
'product_name' => '',
'product_color' => '',
'logo_name' => '',
'setup_number' => '',
'service_width' => '',
'service_height' => '',
'service_setup_unit' => '',
'service_setup_price' => '',
'service_total' => '',
],
]),
]);
}
public function render()
{
return view('livewire.order-products-create');
}
}

@ -0,0 +1,61 @@
<?php
namespace App\Livewire;
use App\Models\Order;
use Illuminate\Support\Carbon;
use Livewire\Component;
use Livewire\WithPagination;
class OrdersTable extends Component
{
use WithPagination;
protected $paginationTheme = 'bootstrap';
public bool $showCustomerColumn;
public string $orderType = 'active';
public string $search = '';
public string $title = '';
public string $customer_id = '';
public Carbon $today;
public function mount(bool $showCustomerColumn, string $orderType, string $title, ?string $customer_id = null)
{
$this->today = Carbon::today();
$this->showCustomerColumn = $showCustomerColumn;
$this->orderType = $orderType;
$this->title = $title;
$this->customer_id = $customer_id ?? '';
}
public function render()
{
return view('livewire.orders-table', [
'orders' => Order::with('customer')
->when($this->customer_id != null, fn ($q) => $q->where('customer_id', $this->customer_id))
->when($this->orderType === 'active', fn ($q) => $q->active())
->when($this->orderType === 'invoiced', fn ($q) => $q->invoiced())
->when($this->orderType === 'finished', fn ($q) => $q->finished())
->when($this->search !== '', function ($query) {
$query->whereHas('customer', function ($query) {
$query->where('company_name', 'like', '%'.$this->search.'%');
})->orWhere('customer_po', 'like', '%'.$this->search.'%')
->orWhere('internal_po', 'like', '%'.$this->search.'%')
->orWhere('order_date', 'like', '%'.$this->search.'%')
->orWhere('due_date', 'like', '%'.$this->search.'%')
->orWhere('status', 'like', '%'.$this->search.'%');
})
->orderByDesc('rush')
->orderBy('due_date')
->paginate(15)
->withQueryString(),
'today' => $this->today,
]);
}
}

@ -0,0 +1,32 @@
<?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 HasFactory, SoftDeletes;
protected $fillable = [
'customer_id',
'first_name',
'last_name',
'email',
'phone',
'notes',
];
public function getFullNameAttribute(): string
{
return $this->first_name.' '.$this->last_name;
}
public function customer(): BelongsTo
{
return $this->belongsTo(Customer::class);
}
}

@ -4,11 +4,12 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
class Customer extends Model
{
use SoftDeletes, HasFactory;
use HasFactory, SoftDeletes;
protected $fillable = [
'company_name',
@ -17,4 +18,24 @@ class Customer extends Model
'billing_address',
'phone',
];
public function contacts(): HasMany
{
return $this->hasMany(Contact::class);
}
public function packingSlips(): HasMany
{
return $this->hasMany(PackingSlip::class);
}
public function shippingEntries(): HasMany
{
return $this->hasMany(ShippingEntry::class);
}
public function orders(): HasMany
{
return $this->hasMany(Order::class);
}
}

@ -0,0 +1,112 @@
<?php
namespace App\Models;
use App\Enums\OrderStatus;
use DateTimeInterface;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
class Order extends Model
{
use HasFactory, SoftDeletes;
protected $fillable = [
'customer_id',
'contact_id',
'internal_po',
'customer_po',
'order_date',
'order_type',
'status',
'due_date',
'rush',
'new_art',
'digitizing',
'repeat',
'purchased_garments',
'customer_supplied_file',
'notes',
];
protected $appends = [
'active',
];
public static function boot()
{
parent::boot();
static::created(function ($model) {
$model->attributes['internal_po'] = $model->generateInternalPo($model->id);
$model->save();
});
}
public function generateInternalPo($id): string
{
$po = str_pad($id, 4, '0', STR_PAD_LEFT);
$year = date('y');
return 'TN'.$year.'-'.$po;
}
public function active(): bool
{
if ($this->status == OrderStatus::APPROVED
|| $this->status == OrderStatus::PRODUCTION) {
return true;
}
return false;
}
public function scopeActive($query)
{
return $query->where('status', 'approved')
->orWhere('status', 'production');
}
public function scopeFinished($query)
{
return $query->where('status', 'shipped')
->orWhere('status', 'completed');
}
public function scopeInvoiced($query)
{
return $query->where('status', 'invoiced');
}
public function scopeRush($query)
{
return $query->where('rush', true);
}
public function customer(): BelongsTo
{
return $this->belongsTo(Customer::class);
}
public function orderProducts(): HasMany
{
return $this->hasMany(OrderProduct::class);
}
public function productServices(): HasMany
{
return $this->hasMany(ProductService::class);
}
protected function serializeDate(DateTimeInterface $date): string
{
return $date->format('Y-m-d');
}
protected $casts = [
'status' => OrderStatus::class,
];
}

@ -0,0 +1,37 @@
<?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\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
class OrderProduct extends Model
{
use HasFactory, SoftDeletes;
protected $fillable = [
'order_id',
'sku',
'product_name',
'color',
];
public function order(): BelongsTo
{
return $this->belongsTo(Order::class);
}
public function serviceFile(): HasOne
{
return $this->hasOne(ServiceFile::class);
}
public function productSize(): HasMany
{
return $this->hasMany(ProductSize::class);
}
}

@ -0,0 +1,26 @@
<?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 HasFactory, SoftDeletes;
protected $fillable = [
'order_id',
'customer_id',
'date_received',
'amount',
'contents',
];
public function customer(): BelongsTo
{
return $this->belongsTo(Customer::class);
}
}

@ -0,0 +1,33 @@
<?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\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
class ProductService extends Model
{
use HasFactory, SoftDeletes;
protected $fillable = [
'order_id',
'service_type',
'placement',
'setup_amount',
'amount',
'amount_price',
];
public function order(): BelongsTo
{
return $this->belongsTo(Order::class);
}
public function serviceFile(): HasOne
{
return $this->hasOne(ServiceFile::class);
}
}

@ -0,0 +1,24 @@
<?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 ProductSize extends Model
{
use HasFactory, SoftDeletes;
protected $fillable = [
'order_product_id',
'size',
'amount',
];
public function orderProduct(): BelongsTo
{
return $this->belongsTo(OrderProduct::class);
}
}

@ -0,0 +1,28 @@
<?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 ServiceFile extends Model
{
use HasFactory, SoftDeletes;
protected $fillable = [
'code',
'product_service_id',
'name',
'width',
'height',
'unit',
'setup_number',
];
public function productService(): BelongsTo
{
return $this->belongsTo(ProductService::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 HasFactory, SoftDeletes;
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);
}
}

@ -41,7 +41,7 @@ class User extends Authenticatable
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
'password' => 'hashed',
];
}
}

@ -2,6 +2,7 @@
namespace App\Providers;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
@ -19,6 +20,6 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot(): void
{
//
Paginator::useBootstrapFive();
}
}

@ -6,12 +6,14 @@
"license": "MIT",
"require": {
"php": "^8.2",
"davidhsianturi/blade-bootstrap-icons": "^1.5",
"laravel/framework": "^11.9",
"laravel/tinker": "^2.9"
"laravel/tinker": "^2.9",
"livewire/livewire": "^3.5"
},
"require-dev": {
"fakerphp/faker": "^1.23",
"laravel/pint": "^1.13",
"laravel/pint": "^1.17",
"laravel/sail": "^1.26",
"laravel/ui": "^4.5",
"mockery/mockery": "^1.6",

236
composer.lock generated

@ -4,8 +4,89 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "73cbed0c4ee4e8f622fc700e5fd9f524",
"content-hash": "ffc721fe90178089f9fb639d3d24a0b4",
"packages": [
{
"name": "blade-ui-kit/blade-icons",
"version": "1.7.1",
"source": {
"type": "git",
"url": "https://github.com/blade-ui-kit/blade-icons.git",
"reference": "8f787baf09d88cdfd6ec4dbaba11ebfa885f0595"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/blade-ui-kit/blade-icons/zipball/8f787baf09d88cdfd6ec4dbaba11ebfa885f0595",
"reference": "8f787baf09d88cdfd6ec4dbaba11ebfa885f0595",
"shasum": ""
},
"require": {
"illuminate/contracts": "^8.0|^9.0|^10.0|^11.0",
"illuminate/filesystem": "^8.0|^9.0|^10.0|^11.0",
"illuminate/support": "^8.0|^9.0|^10.0|^11.0",
"illuminate/view": "^8.0|^9.0|^10.0|^11.0",
"php": "^7.4|^8.0",
"symfony/console": "^5.3|^6.0|^7.0",
"symfony/finder": "^5.3|^6.0|^7.0"
},
"require-dev": {
"mockery/mockery": "^1.5.1",
"orchestra/testbench": "^6.0|^7.0|^8.0|^9.0",
"phpunit/phpunit": "^9.0|^10.5|^11.0"
},
"bin": [
"bin/blade-icons-generate"
],
"type": "library",
"extra": {
"laravel": {
"providers": [
"BladeUI\\Icons\\BladeIconsServiceProvider"
]
}
},
"autoload": {
"files": [
"src/helpers.php"
],
"psr-4": {
"BladeUI\\Icons\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Dries Vints",
"homepage": "https://driesvints.com"
}
],
"description": "A package to easily make use of icons in your Laravel Blade views.",
"homepage": "https://github.com/blade-ui-kit/blade-icons",
"keywords": [
"blade",
"icons",
"laravel",
"svg"
],
"support": {
"issues": "https://github.com/blade-ui-kit/blade-icons/issues",
"source": "https://github.com/blade-ui-kit/blade-icons"
},
"funding": [
{
"url": "https://github.com/sponsors/driesvints",
"type": "github"
},
{
"url": "https://www.paypal.com/paypalme/driesvints",
"type": "paypal"
}
],
"time": "2024-08-14T14:25:11+00:00"
},
{
"name": "brick/math",
"version": "0.12.1",
@ -135,6 +216,67 @@
],
"time": "2024-02-09T16:56:22+00:00"
},
{
"name": "davidhsianturi/blade-bootstrap-icons",
"version": "v1.5.0",
"source": {
"type": "git",
"url": "https://github.com/davidhsianturi/blade-bootstrap-icons.git",
"reference": "21de39c9708fd57bc1108b36792e8bdeebf1c67c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/davidhsianturi/blade-bootstrap-icons/zipball/21de39c9708fd57bc1108b36792e8bdeebf1c67c",
"reference": "21de39c9708fd57bc1108b36792e8bdeebf1c67c",
"shasum": ""
},
"require": {
"blade-ui-kit/blade-icons": "^1.0",
"illuminate/support": "^8.0|^9.0|^10.0|^11.0",
"php": "^7.4|^8.0"
},
"require-dev": {
"orchestra/testbench": "^6.0|^7.0|^8.0|^9.0",
"phpunit/phpunit": "^9.0|^10.5"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Davidhsianturi\\BladeBootstrapIcons\\BladeBootstrapIconsServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Davidhsianturi\\BladeBootstrapIcons\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "David H. Sianturi",
"email": "davidhsianturi@gmail.com",
"homepage": "https://davidhsianturi.com",
"role": "Developer"
}
],
"description": "A package to easily make use of Bootstrap Icons in your Laravel Blade views.",
"homepage": "https://github.com/davidhsianturi/blade-bootstrap-icons",
"keywords": [
"Bootstrap Icons",
"blade",
"laravel"
],
"support": {
"issues": "https://github.com/davidhsianturi/blade-bootstrap-icons/issues",
"source": "https://github.com/davidhsianturi/blade-bootstrap-icons/tree/v1.5.0"
},
"time": "2024-05-09T09:20:43+00:00"
},
{
"name": "dflydev/dot-access-data",
"version": "v3.0.3",
@ -1817,6 +1959,82 @@
],
"time": "2024-01-28T23:22:08+00:00"
},
{
"name": "livewire/livewire",
"version": "v3.5.6",
"source": {
"type": "git",
"url": "https://github.com/livewire/livewire.git",
"reference": "597a2808d8d3001cc3ed5ce89a6ebab00f83b80f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/livewire/livewire/zipball/597a2808d8d3001cc3ed5ce89a6ebab00f83b80f",
"reference": "597a2808d8d3001cc3ed5ce89a6ebab00f83b80f",
"shasum": ""
},
"require": {
"illuminate/database": "^10.0|^11.0",
"illuminate/routing": "^10.0|^11.0",
"illuminate/support": "^10.0|^11.0",
"illuminate/validation": "^10.0|^11.0",
"laravel/prompts": "^0.1.24",
"league/mime-type-detection": "^1.9",
"php": "^8.1",
"symfony/console": "^6.0|^7.0",
"symfony/http-kernel": "^6.2|^7.0"
},
"require-dev": {
"calebporzio/sushi": "^2.1",
"laravel/framework": "^10.15.0|^11.0",
"mockery/mockery": "^1.3.1",
"orchestra/testbench": "^8.21.0|^9.0",
"orchestra/testbench-dusk": "^8.24|^9.1",
"phpunit/phpunit": "^10.4",
"psy/psysh": "^0.11.22|^0.12"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Livewire\\LivewireServiceProvider"
],
"aliases": {
"Livewire": "Livewire\\Livewire"
}
}
},
"autoload": {
"files": [
"src/helpers.php"
],
"psr-4": {
"Livewire\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Caleb Porzio",
"email": "calebporzio@gmail.com"
}
],
"description": "A front-end framework for Laravel.",
"support": {
"issues": "https://github.com/livewire/livewire/issues",
"source": "https://github.com/livewire/livewire/tree/v3.5.6"
},
"funding": [
{
"url": "https://github.com/livewire",
"type": "github"
}
],
"time": "2024-08-19T11:52:18+00:00"
},
{
"name": "monolog/monolog",
"version": "3.7.0",
@ -5867,16 +6085,16 @@
},
{
"name": "laravel/pint",
"version": "v1.17.2",
"version": "v1.17.3",
"source": {
"type": "git",
"url": "https://github.com/laravel/pint.git",
"reference": "e8a88130a25e3f9d4d5785e6a1afca98268ab110"
"reference": "9d77be916e145864f10788bb94531d03e1f7b482"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/pint/zipball/e8a88130a25e3f9d4d5785e6a1afca98268ab110",
"reference": "e8a88130a25e3f9d4d5785e6a1afca98268ab110",
"url": "https://api.github.com/repos/laravel/pint/zipball/9d77be916e145864f10788bb94531d03e1f7b482",
"reference": "9d77be916e145864f10788bb94531d03e1f7b482",
"shasum": ""
},
"require": {
@ -5887,13 +6105,13 @@
"php": "^8.1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.61.1",
"illuminate/view": "^10.48.18",
"friendsofphp/php-cs-fixer": "^3.64.0",
"illuminate/view": "^10.48.20",
"larastan/larastan": "^2.9.8",
"laravel-zero/framework": "^10.4.0",
"mockery/mockery": "^1.6.12",
"nunomaduro/termwind": "^1.15.1",
"pestphp/pest": "^2.35.0"
"pestphp/pest": "^2.35.1"
},
"bin": [
"builds/pint"
@ -5929,7 +6147,7 @@
"issues": "https://github.com/laravel/pint/issues",
"source": "https://github.com/laravel/pint"
},
"time": "2024-08-06T15:11:54+00:00"
"time": "2024-09-03T15:00:28+00:00"
},
{
"name": "laravel/sail",

@ -82,7 +82,7 @@ return [
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
'faker_locale' => env('APP_FAKER_LOCALE', 'en_CA'),
/*
|--------------------------------------------------------------------------
@ -120,7 +120,7 @@ return [
'maintenance' => [
'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
'store' => env('APP_MAINTENANCE_STORE', 'database'),
'store' => env('APP_MAINTENANCE_STORE', 'database'),
],
];

@ -14,7 +14,7 @@ return [
*/
'defaults' => [
'guard' => env('AUTH_GUARD', 'web'),
'guard' => env('AUTH_GUARD', 'web'),
'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
],
@ -37,7 +37,7 @@ return [
'guards' => [
'web' => [
'driver' => 'session',
'driver' => 'session',
'provider' => 'users',
],
],
@ -62,7 +62,7 @@ return [
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => env('AUTH_MODEL', App\Models\User::class),
'model' => env('AUTH_MODEL', App\Models\User::class),
],
// 'users' => [
@ -93,8 +93,8 @@ return [
'passwords' => [
'users' => [
'provider' => 'users',
'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
'expire' => 60,
'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
'expire' => 60,
'throttle' => 60,
],
],

@ -34,28 +34,28 @@ return [
'stores' => [
'array' => [
'driver' => 'array',
'driver' => 'array',
'serialize' => false,
],
'database' => [
'driver' => 'database',
'connection' => env('DB_CACHE_CONNECTION'),
'table' => env('DB_CACHE_TABLE', 'cache'),
'driver' => 'database',
'connection' => env('DB_CACHE_CONNECTION'),
'table' => env('DB_CACHE_TABLE', 'cache'),
'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'),
'lock_table' => env('DB_CACHE_LOCK_TABLE'),
'lock_table' => env('DB_CACHE_LOCK_TABLE'),
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
'lock_path' => storage_path('framework/cache/data'),
],
'memcached' => [
'driver' => 'memcached',
'driver' => 'memcached',
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
'sasl' => [
'sasl' => [
env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'),
],
@ -64,25 +64,25 @@ return [
],
'servers' => [
[
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211),
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211),
'weight' => 100,
],
],
],
'redis' => [
'driver' => 'redis',
'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
'driver' => 'redis',
'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],

@ -32,81 +32,81 @@ return [
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DB_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'driver' => 'sqlite',
'url' => env('DB_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
'busy_timeout' => null,
'journal_mode' => null,
'synchronous' => null,
'busy_timeout' => null,
'journal_mode' => null,
'synchronous' => null,
],
'mysql' => [
'driver' => 'mysql',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => '',
'driver' => 'mysql',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'mariadb' => [
'driver' => 'mariadb',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => '',
'driver' => 'mariadb',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'driver' => 'pgsql',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'prefix_indexes' => true,
'search_path' => 'public',
'sslmode' => 'prefer',
'search_path' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DB_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'driver' => 'sqlsrv',
'url' => env('DB_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'prefix_indexes' => true,
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
@ -126,7 +126,7 @@ return [
*/
'migrations' => [
'table' => 'migrations',
'table' => 'migrations',
'update_date_on_publish' => true,
],
@ -147,24 +147,24 @@ return [
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
],
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'),
],

@ -32,28 +32,28 @@ return [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
'root' => storage_path('app'),
'throw' => false,
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
'throw' => false,
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
'throw' => false,
],
],

@ -33,7 +33,7 @@ return [
'deprecations' => [
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
'trace' => env('LOG_DEPRECATIONS_TRACE', false),
'trace' => env('LOG_DEPRECATIONS_TRACE', false),
],
/*
@ -53,73 +53,73 @@ return [
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => explode(',', env('LOG_STACK', 'single')),
'driver' => 'stack',
'channels' => explode(',', env('LOG_STACK', 'single')),
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => env('LOG_DAILY_DAYS', 14),
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => env('LOG_DAILY_DAYS', 14),
'replace_placeholders' => true,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
'level' => env('LOG_LEVEL', 'critical'),
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
'level' => env('LOG_LEVEL', 'critical'),
'replace_placeholders' => true,
],
'papertrail' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
],
'processors' => [PsrLogMessageProcessor::class],
],
'stderr' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'with' => [
'stream' => 'php://stderr',
],
'processors' => [PsrLogMessageProcessor::class],
],
'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER),
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER),
'replace_placeholders' => true,
],
'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'null' => [
'driver' => 'monolog',
'driver' => 'monolog',
'handler' => NullHandler::class,
],

@ -38,14 +38,14 @@ return [
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'url' => env('MAIL_URL'),
'host' => env('MAIL_HOST', '127.0.0.1'),
'port' => env('MAIL_PORT', 2525),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'transport' => 'smtp',
'url' => env('MAIL_URL'),
'host' => env('MAIL_HOST', '127.0.0.1'),
'port' => env('MAIL_PORT', 2525),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
],
@ -67,12 +67,12 @@ return [
'sendmail' => [
'transport' => 'sendmail',
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
],
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
'channel' => env('MAIL_LOG_CHANNEL'),
],
'array' => [
@ -81,7 +81,7 @@ return [
'failover' => [
'transport' => 'failover',
'mailers' => [
'mailers' => [
'smtp',
'log',
],
@ -89,7 +89,7 @@ return [
'roundrobin' => [
'transport' => 'roundrobin',
'mailers' => [
'mailers' => [
'ses',
'postmark',
],
@ -110,7 +110,7 @@ return [
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
];

@ -35,40 +35,40 @@ return [
],
'database' => [
'driver' => 'database',
'connection' => env('DB_QUEUE_CONNECTION'),
'table' => env('DB_QUEUE_TABLE', 'jobs'),
'queue' => env('DB_QUEUE', 'default'),
'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
'driver' => 'database',
'connection' => env('DB_QUEUE_CONNECTION'),
'table' => env('DB_QUEUE_TABLE', 'jobs'),
'queue' => env('DB_QUEUE', 'default'),
'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
'after_commit' => false,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
'queue' => env('BEANSTALKD_QUEUE', 'default'),
'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
'block_for' => 0,
'driver' => 'beanstalkd',
'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
'queue' => env('BEANSTALKD_QUEUE', 'default'),
'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
'block_for' => 0,
'after_commit' => false,
],
'sqs' => [
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'after_commit' => false,
],
'redis' => [
'driver' => 'redis',
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
'block_for' => null,
'driver' => 'redis',
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
'block_for' => null,
'after_commit' => false,
],
@ -87,7 +87,7 @@ return [
'batching' => [
'database' => env('DB_CONNECTION', 'sqlite'),
'table' => 'job_batches',
'table' => 'job_batches',
],
/*
@ -104,9 +104,9 @@ return [
*/
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('DB_CONNECTION', 'sqlite'),
'table' => 'failed_jobs',
'table' => 'failed_jobs',
],
];

@ -19,7 +19,7 @@ return [
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
@ -31,7 +31,7 @@ return [
'slack' => [
'notifications' => [
'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
],
],

@ -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(),
];
}
}

@ -12,9 +12,18 @@ class CustomerFactory extends Factory
public function definition()
{
$company_name = $this->faker->company();
$internal_name = explode(',', $company_name);
$address = $this->faker->address();
return [
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
'company_name' => $company_name,
'internal_name' => strtolower($internal_name[0]),
'shipping_address' => $address,
'billing_address' => $address,
'phone' => $this->faker->phoneNumber(),
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
];
}
}

@ -0,0 +1,37 @@
<?php
namespace Database\Factories;
use App\Enums\OrderStatus;
use App\Enums\OrderType;
use App\Models\Order;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
class OrderFactory extends Factory
{
protected $model = Order::class;
public function definition(): array
{
$order_date = Carbon::today()->subDays(rand(0, 10));
$due_date = $order_date->copy()->addDays(rand(9, 15));
return [
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
'customer_po' => $this->faker->randomNumber(6, true),
'order_type' => $this->faker->randomElement(OrderType::cases())->value,
'order_date' => $order_date,
'due_date' => $due_date,
'status' => $this->faker->randomELement(OrderStatus::cases())->value,
'rush' => $this->faker->boolean(10),
'new_art' => $this->faker->boolean(),
'digitizing' => $this->faker->boolean(),
'repeat' => $this->faker->boolean(),
'purchased_garments' => $this->faker->boolean(),
'customer_supplied_file' => $this->faker->boolean(),
'notes' => $this->faker->words(10, true),
];
}
}

@ -0,0 +1,23 @@
<?php
namespace Database\Factories;
use App\Models\OrderProduct;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
class OrderProductFactory extends Factory
{
protected $model = OrderProduct::class;
public function definition(): array
{
return [
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
'sku' => $this->faker->randomElement([$this->faker->randomNumber(4, true), null]),
'product_name' => $this->faker->randomElement(['shirts', 'hats', 'jackets', 'pants', 'tote bags', 'backpacks']),
'color' => $this->faker->randomElement(['black', 'white', 'navy', 'red', 'gold', 'charcoal']),
];
}
}

@ -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,25 @@
<?php
namespace Database\Factories;
use App\Models\ProductService;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
class ProductServiceFactory extends Factory
{
protected $model = ProductService::class;
public function definition(): array
{
return [
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
'service_type' => $this->faker->randomElement(['embroidery', 'screen printing', 'dtg', 'vinyl']),
'placement' => $this->faker->randomElement(['l/c', 'c/f', 'f/b', 'r/c']),
'setup_amount' => 0,
'amount' => $this->faker->randomNumber(1),
'amount_price' => 0,
];
}
}

@ -0,0 +1,22 @@
<?php
namespace Database\Factories;
use App\Models\ProductSize;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
class ProductSizeFactory extends Factory
{
protected $model = ProductSize::class;
public function definition(): array
{
return [
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
'size' => $this->faker->randomElement(['xs', 's', 'm', 'l', 'xl', '2xl', '3xl']),
'amount' => $this->faker->randomNumber(2, false),
];
}
}

@ -0,0 +1,25 @@
<?php
namespace Database\Factories;
use App\Models\ServiceFile;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
class ServiceFileFactory extends Factory
{
protected $model = ServiceFile::class;
public function definition(): array
{
return [
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
'code' => $this->faker->randomElement(['A', 'B']).$this->faker->randomNumber(4, true),
'name' => $this->faker->word(),
'width' => round($this->faker->randomFloat(2, 0, 10), 1),
'height' => round($this->faker->randomFloat(2, 0, 10), 1),
'unit' => 'inch',
];
}
}

@ -0,0 +1,28 @@
<?php
namespace Database\Factories;
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']),
];
}
}

@ -24,11 +24,11 @@ class UserFactory extends Factory
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => Hash::make('password'),
'remember_token' => Str::random(10),
'password' => Hash::make('password'),
'remember_token' => Str::random(10),
];
}

@ -21,20 +21,20 @@ return new class extends Migration
$table->timestamps();
});
// Schema::create('password_reset_tokens', function (Blueprint $table) {
// $table->string('email')->primary();
// $table->string('token');
// $table->timestamp('created_at')->nullable();
// });
//
// Schema::create('sessions', function (Blueprint $table) {
// $table->string('id')->primary();
// $table->foreignId('user_id')->nullable()->index();
// $table->string('ip_address', 45)->nullable();
// $table->text('user_agent')->nullable();
// $table->longText('payload');
// $table->integer('last_activity')->index();
// });
Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->primary();
$table->foreignId('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->longText('payload');
$table->integer('last_activity')->index();
});
}
/**

@ -4,11 +4,13 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
public function up()
{
Schema::create('customers', function (Blueprint $table) {
$table->id();
$table->string('company_name');
$table->string('internal_name');
$table->string('shipping_address');

@ -0,0 +1,30 @@
<?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,30 @@
<?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,32 @@
<?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');
}
};

@ -0,0 +1,37 @@
<?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('orders', function (Blueprint $table) {
$table->id();
$table->foreignId('customer_id')->constrained();
$table->foreignId('contact_id')->nullable()->constrained();
$table->string('internal_po')->nullable();
$table->string('customer_po');
$table->string('order_type');
$table->date('order_date');
$table->date('due_date');
$table->string('status');
$table->boolean('rush')->default(0);
$table->boolean('new_art')->default(0);
$table->boolean('digitizing')->default(0);
$table->boolean('repeat')->default(0);
$table->boolean('purchased_garments')->default(0);
$table->boolean('customer_supplied_file')->default(0);
$table->longText('notes')->nullable();
$table->softDeletes();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('orders');
}
};

@ -0,0 +1,26 @@
<?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('order_products', function (Blueprint $table) {
$table->id();
$table->foreignId('order_id')->constrained();
$table->string('sku')->nullable();
$table->string('product_name');
$table->string('color')->nullable();
$table->softDeletes();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('order_products');
}
};

@ -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
{
public function up(): void
{
Schema::create('product_services', function (Blueprint $table) {
$table->id();
$table->foreignId('order_id');
$table->string('service_type');
$table->string('placement');
$table->string('setup_amount');
$table->string('amount')->nullable();
$table->string('amount_price')->nullable();
$table->softDeletes();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('product_services');
}
};

@ -0,0 +1,30 @@
<?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('service_files', function (Blueprint $table) {
$table->id();
$table->foreignId('product_service_id')->constrained();
$table->string('code');
$table->string('name');
$table->string('placement');
$table->decimal('width')->nullable();
$table->decimal('height')->nullable();
$table->string('unit')->default('inch');
$table->integer('setup_number')->nullable();
$table->softDeletes();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('service_files');
}
};

@ -0,0 +1,25 @@
<?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('product_sizes', function (Blueprint $table) {
$table->id();
$table->foreignId('order_product_id');
$table->string('size');
$table->string('amount');
$table->softDeletes();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('product_sizes');
}
};

@ -0,0 +1,92 @@
<?php
namespace Database\Seeders;
use App\Models\Contact;
use App\Models\Customer;
use App\Models\Order;
use App\Models\OrderProduct;
use App\Models\PackingSlip;
use App\Models\ProductService;
use App\Models\ProductSize;
use App\Models\ShippingEntry;
use Illuminate\Database\Seeder;
class CustomerSeeder extends Seeder
{
public function run(): void
{
Customer::factory(3)
->has(Contact::factory(5))
->has(PackingSlip::factory(30))
->has(ShippingEntry::factory(2))
->has(Order::factory(10)
->has(OrderProduct::factory(2)
->has(ProductSize::factory(3)))
->has(ProductService::factory(3)))
// ->has(ServiceFile::factory(1))))
->create();
Customer::factory([
'company_name' => 'Genumark',
'internal_name' => 'genumark',
'shipping_address' => '',
'billing_address' => '',
])
->has(Contact::factory([
'first_name' => 'Tammy',
'last_name' => 'Bookbinder',
'email' => 'tbookbinder@genumark.com',
'phone' => '+1 778 229 5668',
]))
->has(Contact::factory([
'first_name' => 'Kathlyn',
'last_name' => 'Wood',
'email' => 'kwood@genumark.com',
'phone' => '+1 604 294 2376',
'notes' => 'Always CC, unless SOF order',
]))
->has(Contact::factory([
'first_name' => 'Jane',
'last_name' => 'Wellman',
'email' => 'jwellman@genumark.com',
'phone' => '+1 604 742 5584',
'notes' => 'Deals with SOF orders',
]))
->has(Contact::factory([
'first_name' => 'Trisha',
'last_name' => 'Miller',
'email' => 'tmiller@genumark.com',
'phone' => '+1 604 802 8486',
]))
->has(Contact::factory([
'first_name' => 'Brenda',
'last_name' => 'Kuepfer',
'email' => 'bkuepfer@genumark.com',
'phone' => '+1 604 305 5002',
]))
->has(PackingSlip::factory(20))
->has(ShippingEntry::factory([
'account_title' => 'Genumark',
'courier' => 'UPS CampusShip',
'contact' => 'https://www.ups.com/lasso/login',
'account_username' => 'GenumarkTopNotch',
'account_password' => 'TopNotch@13579',
'info_needed' => 'Put PO on box',
'notify' => 'Various reps, CC Kathlyn Wood',
'notes' => 'For Save On Foods orders, see Genumark SOF',
]))
->has(ShippingEntry::factory([
'account_title' => 'Genumark Save-On-Foods',
'courier' => 'UPS CampusShip',
'contact' => 'https://www.ups.com/lasso/login',
'account_username' => 'GenumarkTopNotch',
'account_password' => 'TopNotch@13579',
'info_needed' => 'Put PO on box',
'notify' => 'Jane Wellman',
'notes' => 'Don\'t CC Kathlyn for SOF orders',
]))
->has(Order::factory(10))
->create();
}
}

@ -13,10 +13,12 @@ class DatabaseSeeder extends Seeder
*/
public function run(): void
{
// User::factory(10)->create();
$this->call([
CustomerSeeder::class,
]);
User::factory()->create([
'name' => 'Test User',
'name' => 'Test User',
'email' => 'test@example.com',
]);
}

21
package-lock.json generated

@ -1,9 +1,12 @@
{
"name": "top-notch-website",
"name": "topnotch_website",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"dependencies": {
"bootstrap-icons": "^1.11.3"
},
"devDependencies": {
"@popperjs/core": "^2.11.6",
"axios": "^1.6.4",
@ -712,6 +715,22 @@
"@popperjs/core": "^2.11.8"
}
},
"node_modules/bootstrap-icons": {
"version": "1.11.3",
"resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.11.3.tgz",
"integrity": "sha512-+3lpHrCw/it2/7lBL15VR0HEumaBss0+f/Lb6ZvHISn1mlK83jjFpooTLsMWbIjJMDjDjOExMsTxnXSIT4k4ww==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/twbs"
},
{
"type": "opencollective",
"url": "https://opencollective.com/bootstrap"
}
],
"license": "MIT"
},
"node_modules/braces": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",

@ -12,5 +12,8 @@
"laravel-vite-plugin": "^1.0",
"sass": "^1.56.1",
"vite": "^5.0"
},
"dependencies": {
"bootstrap-icons": "^1.11.3"
}
}

@ -0,0 +1,12 @@
{
"preset": "laravel",
"rules": {
"binary_operator_spaces": {
"default": "single_space",
"operators": {
"=>": "align_single_space_minimal",
"=": "align_single_space_minimal"
}
}
}
}

@ -1 +1,2 @@
import './bootstrap';
import 'bootstrap';

@ -5,4 +5,21 @@
@import 'variables';
// Bootstrap
$body-bg: #fff;
$body-color: #111;
$table-striped-bg: #fafafa;
@import 'bootstrap/scss/bootstrap';
@import 'bootstrap-icons/font/bootstrap-icons.css';
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
display: none;
-webkit-appearance: none;
margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}
input[type=number] {
-moz-appearance: textfield; /* Firefox */
}

@ -5,7 +5,7 @@
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ __('Customers') }}</div>
<div class="card-header">Create contact</div>
<div class="card-body">
@if (session('status'))
@ -15,8 +15,6 @@
@endif
Customer
</div>
</div>
</div>

@ -0,0 +1,106 @@
@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 -->
@include('partials.customers.show.overview-tab')
<!-- Shipping Info tab -->
@include('partials.customers.show.shipping-info-tab')
<!-- Packing Slips tab -->
@include('partials.customers.show.packing-slips-tab')
<!-- Contacts tab -->
@include('partials.customers.show.contacts-tab')
</div>
</div>
</div>
<!-- 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,59 @@
@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>Overview</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="home-tabs" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link link-dark {{$tab == 'active_orders' ? 'active' : ''}}" id="active_orders-tab"
href="{{route('dashboard', ['tab' => 'active_orders'])}}" type="button" role="tab"
aria-controls="active_orders"
aria-selected="{{$tab == 'active_orders' ? 'true' : 'false'}}">
<x-bi-arrow-clockwise/>
Active Orders
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link link-dark {{$tab == 'packing_slips' ? 'active' : ''}}" id="packing-tab"
href="{{route('dashboard', ['tab' => 'packing_slips'])}}" type="button" role="tab"
aria-controls="packing_slips"
aria-selected="{{$tab == 'packing_slips' ? 'true' : 'false'}}">
<x-bi-list-ul/>
Packing Slips
</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">
<div class="tab-pane {{$tab == 'active_orders' ? 'active' : ''}}" id="active_orders" role="tabpanel"
aria-labelledby="active_orders-tab">
<livewire:orders-table :order-type="'active'" :show-customer-column="true" title="Active Orders"/>
</div>
</div>
</div>
</div>
@endsection

@ -1,23 +0,0 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ __('Dashboard') }}</div>
<div class="card-body">
@if (session('status'))
<div class="alert alert-success" role="alert">
{{ session('status') }}
</div>
@endif
{{ __('You are logged in!') }}
</div>
</div>
</div>
</div>
</div>
@endsection

@ -15,66 +15,19 @@
<!-- Scripts -->
@vite(['resources/sass/app.scss', 'resources/js/app.js'])
{{-- @livewireStyles--}}
</head>
<body>
<div id="app">
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
<div class="container">
<a class="navbar-brand" href="{{ url('/') }}">
{{ config('app.name', 'Laravel') }}
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<!-- Left Side Of Navbar -->
<ul class="navbar-nav me-auto">
</ul>
<!-- Right Side Of Navbar -->
<ul class="navbar-nav ms-auto">
<!-- Authentication Links -->
@guest
@if (Route::has('login'))
<li class="nav-item">
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
</li>
@endif
@if (Route::has('register'))
<li class="nav-item">
<a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
</li>
@endif
@else
<li class="nav-item dropdown">
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
{{ Auth::user()->name }}
</a>
<div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="{{ route('logout') }}"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
{{ __('Logout') }}
</a>
<div id="app">
@include('layouts.nav')
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
@csrf
</form>
</div>
</li>
@endguest
</ul>
</div>
</div>
</nav>
<main>
@yield('header')
@yield('content')
</main>
</div>
<main class="py-4">
@yield('content')
</main>
</div>
{{--@livewireScripts--}}
</body>
</html>

@ -0,0 +1,97 @@
<nav class="navbar navbar-expand-md navbar-light bg-white border-bottom">
<div class="container">
<a class="navbar-brand" href="{{ url('/') }}">
{{ config('app.name', 'Laravel') }}
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<!-- Left Side Of Navbar -->
<ul class="navbar-nav me-auto">
<li class="nav-item px-2">
<a class="nav-link @if(request()->routeIs('dashboard')) active @endif "
href="{{route('dashboard')}}">
<x-bi-activity/>
Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link @if(request()->routeIs('search')) active @endif disabled"
href="">
<x-bi-search/>
Search</a>
</li>
<li class="nav-item px-2">
<a class="nav-link @if(request()->routeIs('orders.*')) active @endif"
href="{{route('orders.index')}}">
<x-bi-box/>
Orders</a>
</li>
<li class="nav-item px-2">
<a class="nav-link @if(request()->routeIs('quotes')) active @endif disabled"
href="">
<x-bi-file-text/>
Quotes</a>
</li>
<li class="nav-item px-2">
<a class="nav-link @if(request()->routeIs('invoices')) active @endif disabled"
href="">
<x-bi-envelope/>
Invoices</a>
</li>
<li class="nav-item dropdown px-2">
<a class="nav-link dropdown-toggle @if(request()->routeIs('management.index') || request()->routeIs('customer.*')) active @endif" href="#"
role="button" data-bs-toggle="dropdown" aria-expanded="false">
<x-bi-pencil-square/>
Management
</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item @if(request()->routeIs('customers.*')) fw-bold @endif" href="{{route('management.index')}}">Customers</a></li>
<li><a class="dropdown-item @if(request()->routeIs('packing-slips.*')) fw bold @endif" href="{{route('management.index', 'packing')}}">Packing Slips</a></li>
<li><a class="dropdown-item @if(request()->routeIs('service-files.*')) fw bold @endif" href="{{route('management.index', 'files')}}">Service Files</a></li>
</ul>
</li>
</ul>
<!-- Right Side Of Navbar -->
<ul class="navbar-nav ms-auto">
<!-- Authentication Links -->
@guest
@if (Route::has('login'))
<li class="nav-item">
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
</li>
@endif
@if (Route::has('register'))
<li class="nav-item">
<a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
</li>
@endif
@else
<li class="nav-item dropdown">
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
{{ Auth::user()->name }}
</a>
<div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="{{ route('logout') }}"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
{{ __('Logout') }}
</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
@csrf
</form>
</div>
</li>
@endguest
</ul>
</div>
</div>
</nav>

@ -0,0 +1,44 @@
<div>
<div class="row mb-2">
<label for="customer_id" class="col-md-4 col-form-label text-md-end">Customer</label>
<div class="col-md-6">
<select wire:change="updateContactList" wire:model="selectedCustomer" name="customer_id"
class="form-select form-select-sm" id="customer_id" autofocus required>
@foreach($customers as $customer)
<option value="{{$customer->id}}" {{ old('customer_id') == $customer->id ? "selected" : "" }}>
{{$customer->company_name}}
</option>
@endforeach()
</select>
@error('customer_id')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="row mb-2">
<label for="contact_id" class="col-md-4 col-form-label text-md-end">Contact</label>
<div class="col-md-6">
@if(isset($contacts))
<select wire:model="contacts" wire:key="{{$customer}}" name="contact_id"
class="form-select form-select-sm" id="contact_id">
<option value=""></option>
@foreach($contacts as $contact)
<option value="{{$contact->id}}" {{ old('contact_id') == $contact->id ? "selected" : "" }}>
{{$contact->full_name}}
</option>
@endforeach
</select>
@error('contact_id')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@endif
</div>
</div>
</div>

@ -0,0 +1,299 @@
<div>
<div class="overflow-x-hidden overflow-y-visible" style="max-height: 730px">
<table class="table table-striped table-sm mb-1 ms-0">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">SKU</th>
<th scope="col">Product Name</th>
<th scope="col">Color</th>
<th scope="col">XS</th>
<th scope="col">S</th>
<th scope="col">M</th>
<th scope="col">L</th>
<th scope="col">XL</th>
<th scope="col">2XL</th>
<th scope="col">3XL</th>
<th scope="col">OSFA</th>
<th scope="col">Total</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
@foreach($productInputs as $key => $value)
<tr wire:key="productRow.{{$key}}">
<input type="hidden" name="productInputCount[]" value="1">
<th scope="row" class="align-middle">{{$loop->index+1}}</th>
<td class="col-1">
<!-- SKU -->
<input id="sku_{{$key}}" type="text"
class="form-control form-control-sm @error('sku') is-invalid @enderror"
name="sku[]" value="{{@old('sku')}}" autofocus
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="col-3">
<!-- product_name -->
<input id="product_name_{{$key}}" type="text"
class="form-control form-control-sm @error('product_name') is-invalid @enderror"
name="product_name[]" value="{{@old('product_name')}}"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="col-1">
<!-- product_color -->
<input id="product_color_{{$key}}" type="text" min="0"
class="form-control form-control-sm @error('product_color') is-invalid @enderror"
name="product_color[]" value="{{@old('product_color')}}"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="" style="width: 55px">
<!-- size_xs -->
<input id="size_xs_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('size_xs') is-invalid @enderror"
name="size_xs[]" value="{{@old('size_xs')}}"
wire:model.live="sizes.{{$key}}.xs"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="" style="width: 55px">
<!-- size_s -->
<input id="size_s_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('size_s') is-invalid @enderror"
name="size_s[]" value="{{@old('size_s')}}"
wire:model.live="sizes.{{$key}}.s"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="" style="width: 55px">
<!-- size_m -->
<input id="size_m_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('size_m') is-invalid @enderror"
name="size_m[]" value="{{@old('size_m')}}"
wire:model.live="sizes.{{$key}}.m"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="" style="width: 55px">
<!-- size_l -->
<input id="size_l_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('size_l') is-invalid @enderror"
name="size_l[]" value="{{@old('size_l')}}"
wire:model.live="sizes.{{$key}}.l"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="" style="width: 55px">
<!-- size_xl -->
<input id="size_xl_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('size_xl') is-invalid @enderror"
name="size_xl[]" value="{{@old('size_xl')}}"
wire:model.live="sizes.{{$key}}.xl"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="" style="width: 55px">
<!-- size_2xl -->
<input id="size_2xl_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('size_2xl') is-invalid @enderror"
name="size_2xl[]" value="{{@old('size_2xl')}}"
wire:model.live="sizes.{{$key}}.2xl"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="" style="width: 55px">
<!-- size_3xl -->
<input id="size_3xl_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('size_3xl') is-invalid @enderror"
name="size_3xl[]"
wire:model.live="sizes.{{$key}}.3xl"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td style="width: 55px">
<!-- size_osfa -->
<input id="size_osfa_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('size_osfa') is-invalid @enderror"
name="size_osfa[]" value="{{@old('size_osfa')}}"
wire:model.live="sizes.{{$key}}.osfa"
wire:change="determineAddProductRow({{$loop->index}})"
>
</td>
<td class="col" style="width: 55px">
<input id="product_total_{{$key}}" type="number"
class="form-control form-control-sm @error('product_total') is-invalid @enderror"
name="product_total[]" readonly
wire:model.live="totals.{{$key}}"
>
</td>
<td class="col" style="width: 40px">
@if($key > 0)
<button class="btn btn-sm" type="button" wire:click="removeProductInput({{$key}})">
<x-bi-trash3/>
</button>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="d-flex gap-2">
<label for="total-quantity" class="text-nowrap col-form-label">Total Quantity:</label>
<input type="number" name="total-quantity" id="" class="form-control-plaintext" readonly
wire:model.live="totalQuantity">
</div>
</div>
<!-- Title -->
<div class="row px-2 border-bottom mt-4">
<div class="row fw-bold">
<div class="col-1 px-1 text-end" style="width: 40px;">#</div>
<div class="col-1 px-1">Service</div>
<div class="col-2 px-1">Placement</div>
<div class="col-3 px-1">Logo Name</div>
<div class="col-5">
<div class="row">
<div class="col px-1">Setup</div>
<div class="col px-1">Width</div>
<div class="col px-1">Height</div>
<div class="col px-1">Unit</div>
<div class="col px-1">Price</div>
<div class="col px-1">Total</div>
<div class="col px-1"></div>
</div>
</div>
</div>
</div>
<!-- Row -->
@foreach($serviceInputs as $key => $value)
<div class="row">
<input type="hidden" name="serviceInputCount[]" value="1">
<div class="@if($loop->index % 2 != 1) bg-body-tertiary @endif border-bottom py-2">
<div class="row mb-1">
<div class="row mb-2">
<div class="col-1 px-1 fw-bold text-end" style="width: 40px;">{{$loop->index+1}}</div>
<div class="col-1 px-1">
<input id="service_name_{{$key}}" type="text"
class="form-control form-control-sm m-0 @error('service_name') is-invalid @enderror"
name="service_type[]" value="{{@old('service_name')}}" placeholder="Service"
wire:change="determineAddServiceProductRow({{$loop->index}})">
</div>
<div class="col-2 px-1">
<input id="placement_{{$key}}" type="text"
class="form-control form-control-sm @error('placement') is-invalid @enderror"
name="placement[]" value="{{@old('placement')}}"
wire:change="determineAddServiceProductRow({{$loop->index}})">
</div>
<div class="col-3 px-1">
<input id="logo_name_{{$key}}" type="text"
class="form-control form-control-sm @error('logo_name') is-invalid @enderror"
name="logo_name[]" value="{{@old('logo_name')}}"
wire:change="determineAddServiceProductRow({{$loop->index}})">
</div>
<div class="col-5">
<div class="row">
<div class="col px-1">
<input id="setup_number_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('setup_number') is-invalid @enderror"
name="setup_amount[]" value="{{@old('setup_number')}}"
wire:change="determineAddServiceProductRow({{$loop->index}})">
</div>
<div class="col px-1">
<input id="service_width_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('service_width') is-invalid @enderror"
name="service_width[]" value="{{@old('service_width')}}"
wire:change="determineAddServiceProductRow({{$loop->index}})">
</div>
<div class="col px-1">
<input id="service_height_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('service_height') is-invalid @enderror"
name="service_height[]" value="{{@old('service_height')}}"
wire:change="determineAddServiceProductRow({{$loop->index}})">
</div>
<div class="col px-1">
<input id="service_setup_unit_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('service_setup_unit') is-invalid @enderror"
name="amount[]"
value="{{@old('service_setup_unit')}}"
wire:change="determineAddServiceProductRow({{$loop->index}})"
wire:model.live="units.{{$key}}"
>
</div>
<div class="col px-1">
<input id="service_setup_price_{{$key}}" type="text"
class="form-control form-control-sm @error('service_setup_price') is-invalid @enderror"
name="amount_price[]"
value="{{@old('service_setup_price')}}"
wire:change="determineAddServiceProductRow({{$loop->index}})"
wire:model.live="prices.{{$key}}"
>
</div>
<div class="col px-1">
<input id="service_total_{{$key}}" type="number" precision="2"
class="form-control form-control-sm px-1 @error('service_total') is-invalid @enderror"
name="service_total" readonly
wire:model.live="priceTotals.{{$key}}">
</div>
<div class="col px-1 text-end" style="width: 40px;">
@if($key > 0)
<button class="btn btn-sm" type="button"
wire:click="removeServiceInput({{$key}})">
<x-bi-trash3/>
</button>
@endif
</div>
</div>
</div>
</div>
<div class="row mx-0 px-0">
<div class="col-1" style="width: 40px;"></div>
<div class="col-1 px-1">
<input id="service_file_name_{{$key}}" type="text"
class="form-control form-control-sm @error('service_file_name') is-invalid @enderror"
name="service_file_name[]" value="{{@old('service_file_name')}}"
placeholder="File"
wire:change="determineAddServiceProductRow({{$loop->index}})">
</div>
<div class="col-9 px-1">
<textarea name="contents[]" id="contents_{{$key}}" style="resize: none" rows="2"
class="form-control form-control-sm"
placeholder="Thread colors"
wire:change="determineAddServiceProductRow({{$loop->index}})"
>{{ old('contents') }}</textarea>
</div>
</div>
</div>
</div>
</div>
@endforeach
{{-- <div class="row">--}}
<div class="d-flex flex-row gap-2 ">
<label for="total-price" class="col-form-label text-nowrap">Total Price:</label>
<input type="text" name="total-price" id="" class="col-1 form-control-plaintext" readonly
wire:model.live="totalPrice">
</div>
{{-- </div>--}}
</div>
</div>

@ -0,0 +1,111 @@
<div>
<div class="row justify-content-center mb-3">
<div class="col-9">
<div class="d-flex flex-row gap-2">
<div class="d-inline-flex">
<h4 class="my-auto">{{$this->title}}</h4>
</div>
<div class="mx-auto"></div>
<a href="{{route('orders.create')}}"
class="btn btn-sm btn-primary" title="Create new order...">
<x-bi-plus-circle-fill/>
Create entry
</a>
<div class="vr"></div>
<div class="d-inline-flex">
<select name="" id="" class="form-select form-select-sm">
<option value="">Sort by...</option>
<option value="">Customer</option>
<option value="">Internal PO</option>
<option value="">Customer PO</option>
<option value="">Order Date</option>
<option value="">Due Date</option>
<option value="">Status</option>
<option value="">Rush</option>
</select>
</div>
<div class="d-inline-flex">
<div class="btn-group" role="group">
<button class="btn btn-sm btn-secondary">Asc</button>
<button class="btn btn-sm btn-outline-secondary">Desc</button>
</div>
</div>
<div class="vr"></div>
<div class="d-inline-flex gap-2">
<input wire:model.live.debounce.50ms="search" 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">
<div class="col-9">
<table class="table table-striped table-sm table-hover">
<thead>
<tr class="border-bottom border-black">
{{-- @if($this->showCustomerColumn)--}}
<th scope="col">Customer</th>
{{-- @endif()--}}
<th scope="col">Internal PO</th>
<th scope="col">Customer PO</th>
<th scope="col">Order Date</th>
<th scope="col">Due Date</th>
<th scope="col">Status</th>
<th scope="col">Rush</th>
<th scope="col">View</th>
</tr>
</thead>
<tbody>
@foreach($orders as $order)
<tr class="@if($today > $order->due_date && $order->active()) table-danger @elseif($order->rush && $order->active()) table-warning @endif">
<td><a class="text-reset text-decoration-none"
href="{{route('customers.show', [$order->customer, 'details'])}}">{{$order->customer->company_name}}</a>
</td>
<td class="fw-bold"><code>{{$order->internal_po}}</code></td>
<td class=""><code>{{$order->customer_po}}</code></td>
<td class="text-nowrap">{{$order->order_date}}</td>
<td class="text-nowrap ">
{{$order->due_date}}
@if($order->due_date < $today && $order->active())
<x-bi-exclamation-triangle/>
@endif </td>
<td>{{$order->status->value}}</td>
<td>
@if($order->rush)
<x-bi-check-lg class="text-danger"></x-bi-check-lg>
@endif
</td>
<td class="align-top">
<a class="btn btn-sm btn-outline-secondary px-1 py-0 m-0"
href="">
<x-bi-arrow-right/>
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col"></div>
<div class="col-9">
{{$orders->links()}}
</div>
<div class="col"></div>
</div>
</div>

@ -0,0 +1,27 @@
@extends('layouts.app')
@section('header')
@include('partials.management.index.management-tabs')
@endsection()
@section('content')
<div class="container">
<div class="tab-content">
@include('partials.management.index.customers')
@include('partials.management.index.packing-slips')
@include('partials.management.index.service-files')
</div>
</div>
<!-- Create Customer Modal -->
@include('partials.customers.index.create-modal')
<!-- Delete Customer Modal -->
@include('partials.customers.index.delete-all-modal')
@endsection

@ -0,0 +1,39 @@
@extends('layouts.app')
@section('header')
<div class="container-fluid bg-light pt-3">
<!-- name row -->
<div class="row justify-content-center pb-2">
</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="management-tabs" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link link-dark active" id="order-tab"
href="#" type="button" role="tab" aria-controls="order" aria-selected="true">
<x-bi-box/>
Add Products To Order
</a>
</li>
</ul>
</div>
<div class="col border-bottom"></div>
</div>
</div>
@endsection
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-10 pt-3">
<livewire:order-products-create/>
</div>
</div>
</div>
@endsection

@ -0,0 +1,217 @@
@extends('layouts.app')
@section('header')
<div class="container-fluid bg-light pt-3">
<!-- name row -->
<div class="row justify-content-center pb-2">
</div>
<!-- Tabs row -->
<div class="row justify-content-center mb-2">
<div class="col-3 border-bottom"></div>
<div class="col-6 p-0">
<ul class="nav nav-fill nav-tabs" id="management-tabs" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link link-dark active" id="order-tab"
href="#" type="button" role="tab"
aria-controls="order" aria-selected="true">
<x-bi-box/>
Create Order
</a>
</li>
</ul>
</div>
<div class="col border-bottom"></div>
</div>
</div>
@endsection
@section('content')
<div class="container-fluid mt-3" style="max-width: 1800px">
<form action="{{route('orders.store') }}" method="post">
@csrf
<div class="row justify-content-center">
<div class="col-11 col-xl-4 border-end" style="height: 730px">
<livewire:customer-and-contact-select :customers="$customers"/>
<hr class="border-secondary-subtle px-0">
<div class="row mb-2">
<label for="order_type" class="col-md-4 col-form-label text-md-end">Order Type</label>
<div class="col-md-6">
<select name="order_type" class="form-select form-select-sm" id="order_type">
@foreach($order_types as $case)
<option value="{{$case->name}}">{{$case->value}}</option>
@endforeach()
</select>
@error('order_type')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="row mb-2">
<label for="order_status" class="col-md-4 col-form-label text-md-end">Order
Status</label>
<div class="col-md-6">
<select name="status" class="form-select form-select-sm" id="order_status">
@foreach($order_status as $case)
<option value="{{$case->value}}" {{ $case->name === 'APPROVED' ? 'selected' : '' }}>
{{$case->value}}
</option>
@endforeach()
</select>
@error('status')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<hr class="border-secondary-subtle px-0">
<div class="row mb-2">
<label class="col-md-4 col-form-label text-md-end">Customer PO</label>
<div class="col-md-6">
<input id="customer_po" type="text"
class="form-control form-control-sm @error('customer_po') is-invalid @enderror"
name="customer_po" value="{{@old('customer_po')}}" required>
@error('customer_po')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<hr class="border-secondary-subtle px-0">
<div class="row mb-2">
<label class="col-md-4 col-form-label text-md-end">Attributes</label>
<div class="col-md-3">
<div class="form-check ">
<input class="form-check-input" type="checkbox" id="new_art" name="new_art"
value="1">
<label class="form-check-label" for="new_art">New art</label>
</div>
<div class="form-check ">
<input class="form-check-input" type="checkbox" id="rush" name="rush" value="1">
<label class="form-check-label" for="rush">Rush</label>
</div>
<div class="form-check ">
<input class="form-check-input" type="checkbox" id="digitizing"
name="digitizing" value="1">
<label class="form-check-label" for="digitizing">Digitizing</label>
</div>
<div class="form-check ">
<input class="form-check-input" type="checkbox" id="supplied_file"
name="customer_supplied_file" value="1">
<label class="form-check-label" for="supplied_file">
Customer Supplied File
</label>
</div>
</div>
<div class="col-md-3">
<div class="form-check ">
<input class="form-check-input" type="checkbox" id="repeat" name="repeat"
value="1">
<label class="form-check-label" for="repeat">Repeat</label>
</div>
<div class="form-check ">
<input class="form-check-input" type="checkbox" id="event" name="event"
value="1">
<label class="form-check-label" for="event">Event</label>
</div>
<div class="form-check ">
<input class="form-check-input" type="checkbox" id="purchased_garments"
value="1"
name="purchased_garment">
<label class="form-check-label" for="purchased_garments">
Purchased
garments</label>
</div>
</div>
</div>
<hr class="border-secondary-subtle px-0">
<div class="row mb-2">
<label for="order_date" class="col-md-4 col-form-label text-md-end">Order date</label>
<div class="col-md-6">
<input id="order_date" type="date"
class="form-control form-control-sm @error('order_date') is-invalid @enderror"
name="order_date" value="{{ old('order_date') ?? $today }}" required
>
@error('order_date')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="row mb-2">
<label for="due_date" class="col-md-4 col-form-label text-md-end">Due date</label>
<div class="col-md-6">
<input id="due_date" type="date"
class="form-control form-control-sm @error('due_date') is-invalid @enderror"
name="due_date" value="{{ old('due_date') ?? $due_default }}" required
>
@error('due_date')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<hr class="border-secondary-subtle px-0">
<div class="row mb-2">
<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="4" class="form-control form-control-sm"
>{{ old('notes') }}</textarea>
@error('notes')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
<div class="col-11 col-xl-7">
<livewire:order-products-create/>
</div>
<hr class="border-secondary-subtle px-0">
<div class="row">
<div class="col text-end">
<button type="submit" class="btn btn-primary">
Save Order
</button>
</div>
</div>
</div>
</form>
</div>
@endsection

@ -0,0 +1,91 @@
@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>Overview</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="home-tabs" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link link-dark {{$tab == 'all' ? 'active' : ''}}" id="all-tab"
href="{{route('orders.index', ['tab' => 'all'])}}" type="button" role="tab"
aria-controls="all" aria-selected="{{$tab == 'all' ? 'true' : 'false'}}">
<x-bi-journals/>
All Orders
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link link-dark {{$tab == 'active_orders' ? 'active' : ''}}" id="active-orders-tab"
href="{{route('orders.index', ['tab' => 'active_orders'])}}" type="button" role="tab"
aria-controls="active_orders"
aria-selected="{{$tab == 'active_orders' ? 'true' : 'false'}}">
<x-bi-arrow-clockwise/>
Active Orders
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link link-dark {{$tab == 'finished_orders' ? 'active' : ''}}"
id="finished-orders-tab"
href="{{route('orders.index', ['tab' => 'finished_orders'])}}" type="button" role="tab"
aria-controls="finished_orders"
aria-selected="{{$tab == 'finished_orders' ? 'true' : 'false'}}">
<x-bi-check-all/>
Finished Orders
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link link-dark {{$tab == 'invoice' ? 'active' : ''}}" id="invoice-tab"
href="{{route('orders.index', ['tab' => 'invoice'])}}" type="button" role="tab"
aria-controls="invoice" aria-selected="{{$tab == 'invoice' ? 'true' : 'false'}}">
<x-bi-envelope/>
Invoiced Orders
</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">
<div class="tab-pane {{$tab == 'active_orders' ? 'active' : ''}}" id="active_orders" role="tabpanel"
aria-labelledby="active-orders-tab">
<livewire:orders-table order-type="active" :show-customer-column='true' :title="'Active Orders'"/>
</div>
<div class="tab-pane {{$tab == 'finished_orders' ? 'active' : ''}}" id="finished-orders" role="tabpanel"
aria-labelledby="finished-orders-tab">
<livewire:orders-table order-type="finished" :show-customer-column='true' title="Finished Orders"/>
</div>
<div class="tab-pane {{$tab == 'all' ? 'active' : ''}}" id="all-orders" role="tabpanel"
aria-labelledby="all-orders-tab">
<livewire:orders-table order-type="all" :show-customer-column='true' title="All Orders"/>
</div>
<div class="tab-pane {{$tab == 'invoice' ? 'active' : ''}}" id="invoice-orders" role="tabpanel"
aria-labelledby="invoice-orders-tab">
<livewire:orders-table order-type="invoiced" :show-customer-column='true' title="Invoiced Orders"/>
</div>
</div>
</div>
</div>
@endsection

@ -0,0 +1,71 @@
@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>Overview</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="home-tabs" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link link-dark {{$tab == 'details' ? 'active' : ''}}" id="details-tab"
href="{{route('orders.index', ['tab' => 'details'])}}" type="button" role="tab"
aria-controls="details" aria-selected="{{$tab == 'details' ? 'true' : 'false'}}">
<x-bi-list-ul/>
Order Details
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link link-dark {{$tab == 'timeline' ? 'active' : ''}}" id="timeline-tab"
href="{{route('orders.index', ['tab' => 'timeline'])}}" type="button" role="tab"
aria-controls="timeline" aria-selected="{{$tab == 'timeline' ? 'true' : 'false'}}">
<x-bi-calendar-range/>
Timeline
</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">
<div class="tab-pane {{$tab == 'active_orders' ? 'active' : ''}}" id="active_orders" role="tabpanel"
aria-labelledby="active-orders-tab">
<livewire:orders-table order-type="active" :show-customer-column='true' :title="'Active Orders'"/>
</div>
<div class="tab-pane {{$tab == 'finished_orders' ? 'active' : ''}}" id="finished-orders" role="tabpanel"
aria-labelledby="finished-orders-tab">
<livewire:orders-table order-type="finished" :show-customer-column='true' title="Finished Orders"/>
</div>
<div class="tab-pane {{$tab == 'all' ? 'active' : ''}}" id="all-orders" role="tabpanel"
aria-labelledby="all-orders-tab">
<livewire:orders-table order-type="all" :show-customer-column='true' title="All Orders"/>
</div>
<div class="tab-pane {{$tab == 'invoice' ? 'active' : ''}}" id="invoice-orders" role="tabpanel"
aria-labelledby="invoice-orders-tab">
<livewire:orders-table order-type="invoiced" :show-customer-column='true' title="Invoiced Orders"/>
</div>
</div>
</div>
</div>
@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,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,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,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 class="text-nowrap">{{ $contact->first_name . ' ' . $contact->last_name }}</td>
<td class="text-nowrap"><a href="mailto:{{$contact->email}}">{{ $contact->email }}</a></td>
<td class="text-nowrap">{{ $contact->phone }}</td>
<td class="w-100">{{ $contact->notes }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@else()
No contacts registered for this customer.
@endif()
</div>

@ -0,0 +1,6 @@
<div class="tab-pane {{$tab == 'details' ? 'active' : ''}}" id="details" role="tabpanel"
aria-labelledby="details-tab">
<livewire:orders-table :show-customer-column="false" order-type="active" title="Active orders"
:customer_id="$customer->id"/>
</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-7">
<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 class="text-nowrap">{{$packingSlip->date_received}}</td>
<td class="text-nowrap"><a href="">{{$packingSlip->order_id}}</a></td>
<td class="text-nowrap">{{$packingSlip->amount}}</td>
<td class="w-50">{{$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>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save