diff --git a/app/Livewire/StationLocator/BranchList.php b/app/Livewire/StationLocator/BranchList.php new file mode 100644 index 0000000..230c379 --- /dev/null +++ b/app/Livewire/StationLocator/BranchList.php @@ -0,0 +1,59 @@ +fetchBranches(); + } + + public function fetchBranches() + { + try { + $response = Http::get('https://api.example.com/branches'); + if ($response->successful()) { + $this->branches = $response->json()['data'] ?? []; + } else { + $this->alert('error', 'Failed to fetch branches.'); + } + } catch (\Exception $e) { + $this->alert('error', 'An error occurred: ' . $e->getMessage()); + } + } + + public function delete($id) + { + if (confirm('Are you sure you want to delete this branch?')) { + try { + $this->updating = true; + $response = Http::delete("https://api.example.com/branches/{$id}"); + if ($response->successful()) { + $this->alert('success', 'Branch deleted successfully!'); + $this->fetchBranches(); + } else { + $this->alert('error', 'Failed to delete branch.'); + } + } catch (\Exception $e) { + $this->alert('error', 'An error occurred: ' . $e->getMessage()); + } finally { + $this->updating = false; + } + } + } + + public function render() + { + return view('livewire.station-locator.branch-list')->layout('layouts.app', ['title' => 'Branch List']); + } +} \ No newline at end of file diff --git a/app/Livewire/StationLocator/CreateBranch.php b/app/Livewire/StationLocator/CreateBranch.php new file mode 100644 index 0000000..7bb8b8b --- /dev/null +++ b/app/Livewire/StationLocator/CreateBranch.php @@ -0,0 +1,69 @@ + 'required|string|max:255', + 'name' => 'required|string|max:255', + 'details' => 'required|string|max:255', + ]; + + protected $messages = [ + 'code.required' => 'Branch code is required', + 'name.required' => 'Branch name is required!', + 'details.required' => 'Branch details is required!', + ]; + + public function save() + { + $this->validate(); + + $this->loading = true; + + try { + $response = Http::post('https://api.example.com/branches/add', [ + 'code' => $this->code, + 'name' => $this->name, + 'details' => $this->details, + 'created_by' => auth()->user()->name ?? 'user', // Adjust based on your auth + ]); + + if ($response->successful()) { + $this->alert('success', 'Branch created successfully! Don\'t forget to sync created branch to system parameters.'); + return redirect('/branches'); + } else { + $this->alert('error', 'Failed to create branch.'); + } + } catch (\Exception $e) { + $this->alert('error', 'An error occurred: ' . $e->getMessage()); + } finally { + $this->loading = false; + } + } + + public function cancel() + { + if (confirm('Are you sure you want to discard changes?')) { + return redirect('/branches'); + } + } + + public function render() + { + return view('livewire.station-locator.create-branch')->layout('layouts.app', ['title' => $this->title]); + } +} diff --git a/app/Livewire/StationLocator/AddFuel.php b/app/Livewire/StationLocator/CreateFuel.php similarity index 72% rename from app/Livewire/StationLocator/AddFuel.php rename to app/Livewire/StationLocator/CreateFuel.php index 0502807..26cb55c 100644 --- a/app/Livewire/StationLocator/AddFuel.php +++ b/app/Livewire/StationLocator/CreateFuel.php @@ -1,12 +1,11 @@ 'Fuel name is required!', ]; - public function mount() - { - // Initialize any default values if needed - } - public function save() { $this->validate(); @@ -34,15 +28,16 @@ class AddFuel extends Component $this->loading = true; try { - $response = Http::post('https://api.example.com/fuels', [ + $response = Http::post('https://api.example.com/fuels/add', [ 'name' => $this->name, + 'created_by' => auth()->user()->name ?? 'user', // Adjust based on your auth ]); if ($response->successful()) { - $this->alert('success', 'Fuel saved successfully!'); + $this->alert('success', 'Fuel created successfully! Don\'t forget to sync created fuel to system parameters.'); return redirect('/fuels'); } else { - $this->alert('error', 'Failed to save fuel. Please try again.'); + $this->alert('error', 'Failed to create fuel.'); } } catch (\Exception $e) { $this->alert('error', 'An error occurred: ' . $e->getMessage()); @@ -60,6 +55,6 @@ class AddFuel extends Component public function render() { - return view('livewire.station-locator.add-fuel')->layout('layouts.app', ['title' => $this->title]); + return view('livewire.station-locator.create-fuel')->layout('layouts.app', ['title' => $this->title]); } -} +} \ No newline at end of file diff --git a/app/Livewire/StationLocator/EditBranch.php b/app/Livewire/StationLocator/EditBranch.php new file mode 100644 index 0000000..698f94f --- /dev/null +++ b/app/Livewire/StationLocator/EditBranch.php @@ -0,0 +1,95 @@ + 'required|string|max:255', + 'name' => 'required|string|max:255', + 'details' => 'required|string|max:255', + ]; + + protected $messages = [ + 'code.required' => 'Branch code is required', + 'name.required' => 'Branch name is required!', + 'details.required' => 'Branch details is required!', + ]; + + public function mount($id) + { + $this->id = $id; + $this->fetchBranch(); + } + + public function fetchBranch() + { + try { + $response = Http::get("https://api.example.com/branches/{$this->id}"); + if ($response->successful()) { + $branch = $response->json(); + $this->code = $branch['code']; + $this->name = $branch['name']; + $this->details = $branch['details']; + } else { + $this->alert('error', 'Failed to fetch branch data.'); + return redirect('/branches'); + } + } catch (\Exception $e) { + $this->alert('error', 'An error occurred: ' . $e->getMessage()); + return redirect('/branches'); + } + } + + public function save() + { + $this->validate(); + + $this->loading = true; + + try { + $response = Http::put("https://api.example.com/branches/{$this->id}", [ + 'code' => $this->code, + 'name' => $this->name, + 'details' => $this->details, + 'modified_by' => auth()->user()->name ?? 'user', // Adjust based on your auth + ]); + + if ($response->successful()) { + $this->alert('success', 'Branch updated successfully! Don\'t forget to sync updated branch to system parameters.'); + return redirect('/branches'); + } else { + $this->alert('error', 'Failed to update branch.'); + } + } catch (\Exception $e) { + $this->alert('error', 'An error occurred: ' . $e->getMessage()); + } finally { + $this->loading = false; + } + } + + public function cancel() + { + if (confirm('Are you sure you want to discard changes?')) { + return redirect('/branches'); + } + } + + public function render() + { + return view('livewire.station-locator.edit-branch')->layout('layouts.app', ['title' => $this->title]); + } +} diff --git a/app/Livewire/StationLocator/EditFuel.php b/app/Livewire/StationLocator/EditFuel.php new file mode 100644 index 0000000..fa09289 --- /dev/null +++ b/app/Livewire/StationLocator/EditFuel.php @@ -0,0 +1,85 @@ + 'required|string|max:255', + ]; + + protected $messages = [ + 'name.required' => 'Fuel name is required!', + ]; + + public function mount($id) + { + $this->id = $id; + $this->fetchFuel(); + } + + public function fetchFuel() + { + try { + $response = Http::get("https://api.example.com/fuels/{$this->id}"); + if ($response->successful()) { + $fuel = $response->json(); + $this->name = $fuel['name']; + } else { + $this->alert('error', 'Failed to fetch fuel data.'); + return redirect('/fuels'); + } + } catch (\Exception $e) { + $this->alert('error', 'An error occurred: ' . $e->getMessage()); + return redirect('/fuels'); + } + } + + public function save() + { + $this->validate(); + + $this->loading = true; + + try { + $response = Http::put("https://api.example.com/fuels/{$this->id}", [ + 'name' => $this->name, + 'modified_by' => auth()->user()->name ?? 'user', // Adjust based on your auth + ]); + + if ($response->successful()) { + $this->alert('success', 'Fuel updated successfully! Don\'t forget to sync updated fuel to system parameters.'); + return redirect('/fuels'); + } else { + $this->alert('error', 'Failed to update fuel.'); + } + } catch (\Exception $e) { + $this->alert('error', 'An error occurred: ' . $e->getMessage()); + } finally { + $this->loading = false; + } + } + + public function cancel() + { + if (confirm('Are you sure you want to discard changes?')) { + return redirect('/fuels'); + } + } + + public function render() + { + return view('livewire.station-locator.edit-fuel')->layout('layouts.app', ['title' => $this->title]); + } +} \ No newline at end of file diff --git a/app/Livewire/StationLocator/FuelList.php b/app/Livewire/StationLocator/FuelList.php new file mode 100644 index 0000000..d3fe1c8 --- /dev/null +++ b/app/Livewire/StationLocator/FuelList.php @@ -0,0 +1,58 @@ +fetchFuels(); + } + + public function fetchFuels() + { + try { + $response = Http::get('https://api.example.com/fuels'); + if ($response->successful()) { + $this->fuels = $response->json()['data'] ?? []; + } else { + $this->alert('error', 'Failed to fetch fuels.'); + } + } catch (\Exception $e) { + $this->alert('error', 'An error occurred: ' . $e->getMessage()); + } + } + + public function delete($id) + { + if (confirm('Are you sure you want to delete this fuel?')) { + try { + $this->updating = true; + $response = Http::delete("https://api.example.com/fuels/{$id}"); + if ($response->successful()) { + $this->alert('success', 'Fuel deleted successfully!'); + $this->fetchFuels(); + } else { + $this->alert('error', 'Failed to delete fuel.'); + } + } catch (\Exception $e) { + $this->alert('error', 'An error occurred: ' . $e->getMessage()); + } finally { + $this->updating = false; + } + } + } + + public function render() + { + return view('livewire.station-locator.fuel-list')->layout('layouts.app', ['title' => 'Fuel List']); + } +} \ No newline at end of file diff --git a/app/Livewire/StationLocator/StationCreate.php b/app/Livewire/StationLocator/StationCreate.php index 2848a41..b6db232 100644 --- a/app/Livewire/StationLocator/StationCreate.php +++ b/app/Livewire/StationLocator/StationCreate.php @@ -1,5 +1,4 @@ 'required|string', 'BranchId' => 'required|string', 'contact_number' => 'required|array|min:1', + 'contact_number.*' => 'regex:/^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$/|min:7', 'code' => 'required|string', + 'fuels' => 'required|array|min:1', + 'fuels.*.price' => 'required|numeric|gt:0', ]; protected $messages = [ @@ -41,7 +51,12 @@ class StationCreate extends Component 'long.required' => 'Long is required!', 'BranchId.required' => 'Branch is required!', 'contact_number.required' => 'Contact number is required!', + 'contact_number.*.regex' => 'Please enter a valid contact number', + 'contact_number.*.min' => 'Minimum character is 7', 'code.required' => 'Station code is required!', + 'fuels.required' => 'At least one fuel is required!', + 'fuels.*.price.required' => 'Fuel price is required!', + 'fuels.*.price.gt' => 'Fuel price must be greater than 0!', ]; public function mount() @@ -52,20 +67,65 @@ class StationCreate extends Component public function fetchBranches() { - $response = Http::get('https://api.example.com/branches/noLimit'); - if ($response->successful()) { - $this->branches = $response->json()['data']; + try { + $response = Http::get('https://api.example.com/branches/noLimit'); + if ($response->successful()) { + $this->branches = $response->json()['data'] ?? []; + } else { + $this->alert('error', 'Failed to fetch branches.'); + } + } catch (\Exception $e) { + $this->alert('error', 'An error occurred: ' . $e->getMessage()); } } public function fetchFuels() { - $response = Http::get('https://api.example.com/fuels'); - if ($response->successful()) { - $this->fuelsData = $response->json()['data']; + try { + $response = Http::get('https://api.example.com/fuels'); + if ($response->successful()) { + $this->fuelsData = $response->json()['data'] ?? []; + $this->newFuel = $this->fuelsData; + } else { + $this->alert('error', 'Failed to fetch fuels.'); + } + } catch (\Exception $e) { + $this->alert('error', 'An error occurred: ' . $e->getMessage()); } } + public function updateFuelPrice($index, $price) + { + $this->fuels[$index]['price'] = $price; + } + + public function addToStationFuel() + { + $newFuels = array_filter($this->fuelsData, fn($fuel) => in_array($fuel['id'], $this->selectedFuels)); + $this->fuels = array_merge($this->fuels, array_map(fn($fuel) => [ + 'FuelId' => $fuel['id'], + 'name' => $fuel['name'], + 'price' => '0.00', + ], $newFuels)); + $this->newFuel = array_filter($this->newFuel, fn($fuel) => !in_array($fuel['id'], $this->selectedFuels)); + $this->selectedFuels = []; + $this->fuelModal = false; + } + + public function removeFuel($index, $name) + { + $this->fuelIndex = $index; + $this->fuelName = $name; + $this->removeModal = true; + } + + public function confirmRemoveFuel() + { + $this->fuels = array_filter($this->fuels, fn($_, $i) => $i !== $this->fuelIndex, ARRAY_FILTER_USE_BOTH); + $this->removeModal = false; + $this->fetchFuels(); + } + public function save() { $this->validate(); @@ -73,23 +133,27 @@ class StationCreate extends Component $this->loading = true; try { - $response = Http::post('https://api.example.com/stations', [ + $response = Http::post('https://api.example.com/stations/add', [ 'name' => $this->name, 'location' => $this->location, - 'map_URL' => $this->map_URL, + 'map_Url' => $this->map_URL, 'lat' => $this->lat, 'long' => $this->long, - 'BranchId' => $this->BranchId, 'contact_number' => implode(',', $this->contact_number), + 'created_by' => auth()->user()->name ?? 'user', // Adjust based on your auth + 'BranchId' => $this->BranchId, 'code' => $this->code, - 'fuels' => $this->fuels, + 'StationFuels' => array_map(fn($fuel) => [ + 'FuelId' => $fuel['FuelId'], + 'price' => $fuel['price'], + ], $this->fuels), ]); if ($response->successful()) { - $this->alert('success', 'Station saved successfully!'); + $this->alert('success', 'Station created successfully!'); return redirect('/stations'); } else { - $this->alert('error', 'Failed to save station. Please try again.'); + $this->alert('error', 'Failed to create station.'); } } catch (\Exception $e) { $this->alert('error', 'An error occurred: ' . $e->getMessage()); @@ -105,11 +169,19 @@ class StationCreate extends Component } } + public function updateMap($lat, $long, $url = '') + { + $this->lat = $lat; + $this->long = $long; + $this->map_URL = $url ?: $this->map_URL; + } + public function render() { return view('livewire.station-locator.station-create', [ - 'branches' => $this->branches ?? [], - 'fuelsData' => $this->fuelsData ?? [], + 'branches' => $this->branches, + 'fuelsData' => $this->fuelsData, + 'newFuel' => $this->newFuel, ])->layout('layouts.app', ['title' => $this->title]); } -} +} \ No newline at end of file diff --git a/composer.json b/composer.json index 4c37cdf..a213a2f 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,8 @@ "laravel/tinker": "^2.9", "laravel/ui": "^4.6", "livewire/livewire": "^3.6", - "paragonie/sodium_compat": "^2.1" + "paragonie/sodium_compat": "^2.1", + "yajra/laravel-datatables": "*" }, "require-dev": { "fakerphp/faker": "^1.23", diff --git a/composer.lock b/composer.lock index 5b9927d..730d84c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cbf41d952611e3353e0bca416abca632", + "content-hash": "f3043b4a84596db547c9bdbe2cdb01fd", "packages": [ { "name": "brick/math", @@ -135,6 +135,85 @@ ], "time": "2024-02-09T16:56:22+00:00" }, + { + "name": "composer/pcre", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, + "require-dev": { + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" + }, + "type": "library", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.3.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-11-12T16:29:46+00:00" + }, { "name": "dflydev/dot-access-data", "version": "v3.0.3", @@ -2038,6 +2117,76 @@ }, "time": "2024-08-09T21:24:39+00:00" }, + { + "name": "league/fractal", + "version": "0.20.2", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/fractal.git", + "reference": "573ca2e0e348a7fe573a3e8fbc29a6588ece8c4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/fractal/zipball/573ca2e0e348a7fe573a3e8fbc29a6588ece8c4e", + "reference": "573ca2e0e348a7fe573a3e8fbc29a6588ece8c4e", + "shasum": "" + }, + "require": { + "php": ">=7.4" + }, + "require-dev": { + "doctrine/orm": "^2.5", + "illuminate/contracts": "~5.0", + "laminas/laminas-paginator": "~2.12", + "mockery/mockery": "^1.3", + "pagerfanta/pagerfanta": "~1.0.0|~4.0.0", + "phpstan/phpstan": "^1.4", + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "~3.4", + "vimeo/psalm": "^4.30" + }, + "suggest": { + "illuminate/pagination": "The Illuminate Pagination component.", + "laminas/laminas-paginator": "Laminas Framework Paginator", + "pagerfanta/pagerfanta": "Pagerfanta Paginator" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.20.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Fractal\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Sturgeon", + "email": "me@philsturgeon.uk", + "homepage": "http://philsturgeon.uk/", + "role": "Developer" + } + ], + "description": "Handle the output of complex data structures ready for API output.", + "homepage": "http://fractal.thephpleague.com/", + "keywords": [ + "api", + "json", + "league", + "rest" + ], + "support": { + "issues": "https://github.com/thephpleague/fractal/issues", + "source": "https://github.com/thephpleague/fractal/tree/0.20.2" + }, + "time": "2025-02-14T21:33:14+00:00" + }, { "name": "league/mime-type-detection", "version": "1.16.0", @@ -2344,6 +2493,191 @@ ], "time": "2025-03-12T20:24:15+00:00" }, + { + "name": "maennchen/zipstream-php", + "version": "3.1.2", + "source": { + "type": "git", + "url": "https://github.com/maennchen/ZipStream-PHP.git", + "reference": "aeadcf5c412332eb426c0f9b4485f6accba2a99f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/aeadcf5c412332eb426c0f9b4485f6accba2a99f", + "reference": "aeadcf5c412332eb426c0f9b4485f6accba2a99f", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-zlib": "*", + "php-64bit": "^8.2" + }, + "require-dev": { + "brianium/paratest": "^7.7", + "ext-zip": "*", + "friendsofphp/php-cs-fixer": "^3.16", + "guzzlehttp/guzzle": "^7.5", + "mikey179/vfsstream": "^1.6", + "php-coveralls/php-coveralls": "^2.5", + "phpunit/phpunit": "^11.0", + "vimeo/psalm": "^6.0" + }, + "suggest": { + "guzzlehttp/psr7": "^2.4", + "psr/http-message": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ZipStream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paul Duncan", + "email": "pabs@pablotron.org" + }, + { + "name": "Jonatan Männchen", + "email": "jonatan@maennchen.ch" + }, + { + "name": "Jesse Donat", + "email": "donatj@gmail.com" + }, + { + "name": "András Kolesár", + "email": "kolesar@kolesar.hu" + } + ], + "description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.", + "keywords": [ + "stream", + "zip" + ], + "support": { + "issues": "https://github.com/maennchen/ZipStream-PHP/issues", + "source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.2" + }, + "funding": [ + { + "url": "https://github.com/maennchen", + "type": "github" + } + ], + "time": "2025-01-27T12:07:53+00:00" + }, + { + "name": "markbaker/complex", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPComplex.git", + "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9", + "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-master", + "phpcompatibility/php-compatibility": "^9.3", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Complex\\": "classes/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@lange.demon.co.uk" + } + ], + "description": "PHP Class for working with complex numbers", + "homepage": "https://github.com/MarkBaker/PHPComplex", + "keywords": [ + "complex", + "mathematics" + ], + "support": { + "issues": "https://github.com/MarkBaker/PHPComplex/issues", + "source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2" + }, + "time": "2022-12-06T16:21:08+00:00" + }, + { + "name": "markbaker/matrix", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPMatrix.git", + "reference": "728434227fe21be27ff6d86621a1b13107a2562c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c", + "reference": "728434227fe21be27ff6d86621a1b13107a2562c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-master", + "phpcompatibility/php-compatibility": "^9.3", + "phpdocumentor/phpdocumentor": "2.*", + "phploc/phploc": "^4.0", + "phpmd/phpmd": "2.*", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "sebastian/phpcpd": "^4.0", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Matrix\\": "classes/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@demon-angel.eu" + } + ], + "description": "PHP Class for working with matrices", + "homepage": "https://github.com/MarkBaker/PHPMatrix", + "keywords": [ + "mathematics", + "matrix", + "vector" + ], + "support": { + "issues": "https://github.com/MarkBaker/PHPMatrix/issues", + "source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1" + }, + "time": "2022-12-02T22:17:43+00:00" + }, { "name": "mobiledetect/mobiledetectlib", "version": "2.8.45", @@ -2908,6 +3242,99 @@ ], "time": "2024-11-21T10:39:51+00:00" }, + { + "name": "openspout/openspout", + "version": "v4.28.5", + "source": { + "type": "git", + "url": "https://github.com/openspout/openspout.git", + "reference": "ab05a09fe6fce57c90338f83280648a9786ce36b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/openspout/openspout/zipball/ab05a09fe6fce57c90338f83280648a9786ce36b", + "reference": "ab05a09fe6fce57c90338f83280648a9786ce36b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-fileinfo": "*", + "ext-filter": "*", + "ext-libxml": "*", + "ext-xmlreader": "*", + "ext-zip": "*", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0" + }, + "require-dev": { + "ext-zlib": "*", + "friendsofphp/php-cs-fixer": "^3.68.3", + "infection/infection": "^0.29.10", + "phpbench/phpbench": "^1.4.0", + "phpstan/phpstan": "^2.1.2", + "phpstan/phpstan-phpunit": "^2.0.4", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "^11.5.4" + }, + "suggest": { + "ext-iconv": "To handle non UTF-8 CSV files (if \"php-mbstring\" is not already installed or is too limited)", + "ext-mbstring": "To handle non UTF-8 CSV files (if \"iconv\" is not already installed)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "OpenSpout\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Adrien Loison", + "email": "adrien@box.com" + } + ], + "description": "PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way", + "homepage": "https://github.com/openspout/openspout", + "keywords": [ + "OOXML", + "csv", + "excel", + "memory", + "odf", + "ods", + "office", + "open", + "php", + "read", + "scale", + "spreadsheet", + "stream", + "write", + "xlsx" + ], + "support": { + "issues": "https://github.com/openspout/openspout/issues", + "source": "https://github.com/openspout/openspout/tree/v4.28.5" + }, + "funding": [ + { + "url": "https://paypal.me/filippotessarotto", + "type": "custom" + }, + { + "url": "https://github.com/Slamdunk", + "type": "github" + } + ], + "time": "2025-01-30T13:51:11+00:00" + }, { "name": "paragonie/sodium_compat", "version": "v2.1.0", @@ -2999,6 +3426,111 @@ }, "time": "2024-09-04T12:51:01+00:00" }, + { + "name": "phpoffice/phpspreadsheet", + "version": "2.3.8", + "source": { + "type": "git", + "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", + "reference": "7a700683743bf1c4a21837c84b266916f1aa7d25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/7a700683743bf1c4a21837c84b266916f1aa7d25", + "reference": "7a700683743bf1c4a21837c84b266916f1aa7d25", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "ext-ctype": "*", + "ext-dom": "*", + "ext-fileinfo": "*", + "ext-gd": "*", + "ext-iconv": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "ext-xml": "*", + "ext-xmlreader": "*", + "ext-xmlwriter": "*", + "ext-zip": "*", + "ext-zlib": "*", + "maennchen/zipstream-php": "^2.1 || ^3.0", + "markbaker/complex": "^3.0", + "markbaker/matrix": "^3.0", + "php": "^8.1", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-main", + "dompdf/dompdf": "^2.0 || ^3.0", + "friendsofphp/php-cs-fixer": "^3.2", + "mitoteam/jpgraph": "^10.3", + "mpdf/mpdf": "^8.1.1", + "phpcompatibility/php-compatibility": "^9.3", + "phpstan/phpstan": "^1.1", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^9.6 || ^10.5", + "squizlabs/php_codesniffer": "^3.7", + "tecnickcom/tcpdf": "^6.5" + }, + "suggest": { + "dompdf/dompdf": "Option for rendering PDF with PDF Writer", + "ext-intl": "PHP Internationalization Functions", + "mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers", + "mpdf/mpdf": "Option for rendering PDF with PDF Writer", + "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Maarten Balliauw", + "homepage": "https://blog.maartenballiauw.be" + }, + { + "name": "Mark Baker", + "homepage": "https://markbakeruk.net" + }, + { + "name": "Franck Lefevre", + "homepage": "https://rootslabs.net" + }, + { + "name": "Erik Tilt" + }, + { + "name": "Adrien Crivelli" + } + ], + "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", + "homepage": "https://github.com/PHPOffice/PhpSpreadsheet", + "keywords": [ + "OpenXML", + "excel", + "gnumeric", + "ods", + "php", + "spreadsheet", + "xls", + "xlsx" + ], + "support": { + "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/2.3.8" + }, + "time": "2025-02-08T03:01:45+00:00" + }, { "name": "phpoption/phpoption", "version": "1.9.3", @@ -6275,6 +6807,543 @@ "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, "time": "2022-06-03T18:03:27+00:00" + }, + { + "name": "yajra/laravel-datatables", + "version": "v11.0.0", + "source": { + "type": "git", + "url": "https://github.com/yajra/datatables.git", + "reference": "5ab0fccf229161df95e435582ed123efa8aa3f50" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yajra/datatables/zipball/5ab0fccf229161df95e435582ed123efa8aa3f50", + "reference": "5ab0fccf229161df95e435582ed123efa8aa3f50", + "shasum": "" + }, + "require": { + "php": "^8.2", + "yajra/laravel-datatables-buttons": "^11", + "yajra/laravel-datatables-editor": "^11", + "yajra/laravel-datatables-export": "^11", + "yajra/laravel-datatables-fractal": "^11", + "yajra/laravel-datatables-html": "^11", + "yajra/laravel-datatables-oracle": "^11" + }, + "require-dev": { + "larastan/larastan": "^2.9.1", + "laravel/pint": "^1.14", + "orchestra/testbench": "^9", + "rector/rector": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "11.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Arjay Angeles", + "email": "aqangeles@gmail.com" + } + ], + "description": "Laravel DataTables Complete Package.", + "keywords": [ + "datatables", + "jquery", + "laravel" + ], + "support": { + "issues": "https://github.com/yajra/datatables/issues", + "source": "https://github.com/yajra/datatables/tree/v11.0.0" + }, + "funding": [ + { + "url": "https://github.com/sponsors/yajra", + "type": "github" + } + ], + "time": "2024-03-16T04:34:31+00:00" + }, + { + "name": "yajra/laravel-datatables-buttons", + "version": "v11.2.2", + "source": { + "type": "git", + "url": "https://github.com/yajra/laravel-datatables-buttons.git", + "reference": "78c84636f4bb56efb149f694b67784ed651cf0ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yajra/laravel-datatables-buttons/zipball/78c84636f4bb56efb149f694b67784ed651cf0ad", + "reference": "78c84636f4bb56efb149f694b67784ed651cf0ad", + "shasum": "" + }, + "require": { + "illuminate/console": "^11", + "php": "^8.2", + "yajra/laravel-datatables-html": "^11", + "yajra/laravel-datatables-oracle": "^11" + }, + "require-dev": { + "larastan/larastan": "^2.9.2", + "laravel/pint": "^1.14", + "maatwebsite/excel": "^3.1.55", + "orchestra/testbench": "^9", + "rap2hpoutre/fast-excel": "^5.4", + "rector/rector": "^1.0.2" + }, + "suggest": { + "barryvdh/laravel-snappy": "Allows exporting of dataTable to PDF using the print view.", + "dompdf/dompdf": "Allows exporting of dataTable to PDF using the DomPDF.", + "maatwebsite/excel": "Exporting of dataTables (excel, csv and PDF) using maatwebsite package.", + "rap2hpoutre/fast-excel": "Faster exporting of dataTables using fast-excel package.", + "yajra/laravel-datatables-export": "Exporting of dataTables (excel, csv and PDF) via livewire and queue worker." + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Yajra\\DataTables\\ButtonsServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "11.0-dev" + } + }, + "autoload": { + "psr-4": { + "Yajra\\DataTables\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Arjay Angeles", + "email": "aqangeles@gmail.com" + } + ], + "description": "Laravel DataTables Buttons Plugin.", + "keywords": [ + "buttons", + "datatables", + "jquery", + "laravel" + ], + "support": { + "issues": "https://github.com/yajra/laravel-datatables-buttons/issues", + "source": "https://github.com/yajra/laravel-datatables-buttons/tree/v11.2.2" + }, + "funding": [ + { + "url": "https://github.com/sponsors/yajra", + "type": "github" + } + ], + "time": "2025-01-18T11:12:52+00:00" + }, + { + "name": "yajra/laravel-datatables-editor", + "version": "v11.0.2", + "source": { + "type": "git", + "url": "https://github.com/yajra/laravel-datatables-editor.git", + "reference": "f49f2bcfab26d4233d04280aab7787418d9d6334" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yajra/laravel-datatables-editor/zipball/f49f2bcfab26d4233d04280aab7787418d9d6334", + "reference": "f49f2bcfab26d4233d04280aab7787418d9d6334", + "shasum": "" + }, + "require": { + "illuminate/console": "^11", + "illuminate/database": "^11", + "illuminate/http": "^11", + "illuminate/validation": "^11", + "php": "^8.2" + }, + "require-dev": { + "larastan/larastan": "^2.9.1", + "laravel/pint": "^1.14", + "orchestra/testbench": "^9.0", + "rector/rector": "^1.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Yajra\\DataTables\\EditorServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "11.x-dev" + } + }, + "autoload": { + "psr-4": { + "Yajra\\DataTables\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Arjay Angeles", + "email": "aqangeles@gmail.com" + } + ], + "description": "Laravel DataTables Editor plugin for Laravel 5.5+.", + "keywords": [ + "JS", + "datatables", + "editor", + "html", + "jquery", + "laravel" + ], + "support": { + "issues": "https://github.com/yajra/laravel-datatables-editor/issues", + "source": "https://github.com/yajra/laravel-datatables-editor/tree/v11.0.2" + }, + "funding": [ + { + "url": "https://www.paypal.me/yajra", + "type": "custom" + }, + { + "url": "https://github.com/yajra", + "type": "github" + }, + { + "url": "https://www.patreon.com/yajra", + "type": "patreon" + } + ], + "time": "2024-09-20T02:44:39+00:00" + }, + { + "name": "yajra/laravel-datatables-export", + "version": "v11.4.3", + "source": { + "type": "git", + "url": "https://github.com/yajra/laravel-datatables-export.git", + "reference": "a978a42c82f6177fd5301c6a1a2a46089745adea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yajra/laravel-datatables-export/zipball/a978a42c82f6177fd5301c6a1a2a46089745adea", + "reference": "a978a42c82f6177fd5301c6a1a2a46089745adea", + "shasum": "" + }, + "require": { + "ext-json": "*", + "livewire/livewire": "^2.11.2|^3.5.6", + "openspout/openspout": "^4.24.5", + "php": "^8.2", + "phpoffice/phpspreadsheet": "^1.29.9|^2.3.7", + "yajra/laravel-datatables-buttons": "^11.0" + }, + "require-dev": { + "larastan/larastan": "^2.9.8", + "laravel/pint": "^1.17.2", + "orchestra/testbench": "^9.4.0", + "pestphp/pest": "^2.35.1", + "pestphp/pest-plugin-laravel": "^2.4", + "rector/rector": "^1.2.4" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Yajra\\DataTables\\ExportServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "11.x-dev" + } + }, + "autoload": { + "psr-4": { + "Yajra\\DataTables\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Arjay Angeles", + "email": "aqangeles@gmail.com" + } + ], + "description": "Laravel DataTables Queued Export Plugin.", + "keywords": [ + "datatables", + "excel", + "export", + "laravel", + "livewire", + "queue" + ], + "support": { + "issues": "https://github.com/yajra/laravel-datatables-export/issues", + "source": "https://github.com/yajra/laravel-datatables-export/tree/v11.4.3" + }, + "funding": [ + { + "url": "https://github.com/sponsors/yajra", + "type": "github" + } + ], + "time": "2025-04-12T13:01:17+00:00" + }, + { + "name": "yajra/laravel-datatables-fractal", + "version": "v11.0.0", + "source": { + "type": "git", + "url": "https://github.com/yajra/laravel-datatables-fractal.git", + "reference": "94141d03aff187aeb3f98a0a735e1c89ae50ad06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yajra/laravel-datatables-fractal/zipball/94141d03aff187aeb3f98a0a735e1c89ae50ad06", + "reference": "94141d03aff187aeb3f98a0a735e1c89ae50ad06", + "shasum": "" + }, + "require": { + "league/fractal": "^0.20.1", + "php": "^8.2", + "yajra/laravel-datatables-oracle": "^11.0" + }, + "require-dev": { + "nunomaduro/larastan": "^2.9.2", + "orchestra/testbench": "^9" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Yajra\\DataTables\\FractalServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "11.x-dev" + } + }, + "autoload": { + "psr-4": { + "Yajra\\DataTables\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Arjay Angeles", + "email": "aqangeles@gmail.com" + } + ], + "description": "Laravel DataTables Fractal Plugin.", + "keywords": [ + "api", + "datatables", + "fractal", + "laravel" + ], + "support": { + "issues": "https://github.com/yajra/laravel-datatables-fractal/issues", + "source": "https://github.com/yajra/laravel-datatables-fractal/tree/v11.0.0" + }, + "time": "2024-03-14T06:16:28+00:00" + }, + { + "name": "yajra/laravel-datatables-html", + "version": "v11.8.1", + "source": { + "type": "git", + "url": "https://github.com/yajra/laravel-datatables-html.git", + "reference": "76cb7a423c84fa81cc5c6418cbb8c3c95d1a4f89" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yajra/laravel-datatables-html/zipball/76cb7a423c84fa81cc5c6418cbb8c3c95d1a4f89", + "reference": "76cb7a423c84fa81cc5c6418cbb8c3c95d1a4f89", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^8.2", + "yajra/laravel-datatables-oracle": "^11.0" + }, + "require-dev": { + "larastan/larastan": "^2.9.1", + "laravel/pint": "^1.14", + "livewire/livewire": "^3.4", + "orchestra/testbench": "^9", + "rector/rector": "^1.0" + }, + "suggest": { + "laravel/livewire": "Required for Livewire layout support." + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Yajra\\DataTables\\HtmlServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "11.0-dev" + } + }, + "autoload": { + "psr-4": { + "Yajra\\DataTables\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Arjay Angeles", + "email": "aqangeles@gmail.com" + } + ], + "description": "Laravel DataTables HTML builder plugin", + "keywords": [ + "JS", + "datatables", + "html", + "jquery", + "laravel", + "yajra" + ], + "support": { + "issues": "https://github.com/yajra/laravel-datatables-html/issues", + "source": "https://github.com/yajra/laravel-datatables-html/tree/v11.8.1" + }, + "funding": [ + { + "url": "https://www.paypal.me/yajra", + "type": "custom" + }, + { + "url": "https://github.com/yajra", + "type": "github" + }, + { + "url": "https://www.patreon.com/yajra", + "type": "patreon" + } + ], + "time": "2025-02-19T02:11:43+00:00" + }, + { + "name": "yajra/laravel-datatables-oracle", + "version": "v11.1.6", + "source": { + "type": "git", + "url": "https://github.com/yajra/laravel-datatables.git", + "reference": "b48eb614d0474c23a9c8041563beef9dda39656d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/b48eb614d0474c23a9c8041563beef9dda39656d", + "reference": "b48eb614d0474c23a9c8041563beef9dda39656d", + "shasum": "" + }, + "require": { + "illuminate/database": "^11", + "illuminate/filesystem": "^11", + "illuminate/http": "^11", + "illuminate/support": "^11", + "illuminate/view": "^11", + "php": "^8.2" + }, + "require-dev": { + "algolia/algoliasearch-client-php": "^3.4.1", + "larastan/larastan": "^2.9.1", + "laravel/pint": "^1.14", + "laravel/scout": "^10.8.3", + "meilisearch/meilisearch-php": "^1.6.1", + "orchestra/testbench": "^9", + "rector/rector": "^1.0" + }, + "suggest": { + "yajra/laravel-datatables-buttons": "Plugin for server-side exporting of dataTables.", + "yajra/laravel-datatables-editor": "Plugin to use DataTables Editor (requires a license).", + "yajra/laravel-datatables-export": "Plugin for server-side exporting using livewire and queue worker.", + "yajra/laravel-datatables-fractal": "Plugin for server-side response using Fractal.", + "yajra/laravel-datatables-html": "Plugin for server-side HTML builder of dataTables." + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "DataTables": "Yajra\\DataTables\\Facades\\DataTables" + }, + "providers": [ + "Yajra\\DataTables\\DataTablesServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "11.x-dev" + } + }, + "autoload": { + "files": [ + "src/helper.php" + ], + "psr-4": { + "Yajra\\DataTables\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Arjay Angeles", + "email": "aqangeles@gmail.com" + } + ], + "description": "jQuery DataTables API for Laravel", + "keywords": [ + "datatables", + "jquery", + "laravel", + "yajra" + ], + "support": { + "issues": "https://github.com/yajra/laravel-datatables/issues", + "source": "https://github.com/yajra/laravel-datatables/tree/v11.1.6" + }, + "funding": [ + { + "url": "https://github.com/sponsors/yajra", + "type": "github" + } + ], + "time": "2025-01-21T03:15:46+00:00" } ], "packages-dev": [ diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 9b62aeb..f8f363f 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -8,6 +8,9 @@
+ + + @if(app()->environment('local')) + + + + + +Are you sure you want to remove {{ $fuelName }}?
+