From 657c38c85adee28181ad3a325efb43019068babe Mon Sep 17 00:00:00 2001 From: armiejean Date: Sun, 13 Apr 2025 18:45:42 +0800 Subject: [PATCH] converting react.js codes to laravel php --- app/Livewire/StationLocator/AddBranch.php | 68 +++++ app/Livewire/StationLocator/AddFuel.php | 65 +++++ app/Livewire/StationLocator/EditStation.php | 234 ++++++++++++++++++ app/Livewire/StationLocator/StationCreate.php | 115 +++++++++ app/Livewire/StationLocator/StationList.php | 71 ++++++ composer.json | 1 + composer.lock | 66 ++++- package-lock.json | 2 +- package.json | 1 + resources/views/layouts/app.blade.php | 4 + .../station-locator/add-branch.blade.php | 45 ++++ .../station-locator/add-fuel.blade.php | 29 +++ .../station-locator/edit-station.blade.php | 208 ++++++++++++++++ .../station-locator/station-create.blade.php | 122 +++++++++ .../station-locator/station-list.blade.php | 64 +++++ routes/web.php | 36 ++- 16 files changed, 1120 insertions(+), 11 deletions(-) create mode 100644 app/Livewire/StationLocator/AddBranch.php create mode 100644 app/Livewire/StationLocator/AddFuel.php create mode 100644 app/Livewire/StationLocator/EditStation.php create mode 100644 app/Livewire/StationLocator/StationCreate.php create mode 100644 app/Livewire/StationLocator/StationList.php create mode 100644 resources/views/livewire/station-locator/add-branch.blade.php create mode 100644 resources/views/livewire/station-locator/add-fuel.blade.php create mode 100644 resources/views/livewire/station-locator/edit-station.blade.php create mode 100644 resources/views/livewire/station-locator/station-create.blade.php create mode 100644 resources/views/livewire/station-locator/station-list.blade.php diff --git a/app/Livewire/StationLocator/AddBranch.php b/app/Livewire/StationLocator/AddBranch.php new file mode 100644 index 0000000..9ab4c37 --- /dev/null +++ b/app/Livewire/StationLocator/AddBranch.php @@ -0,0 +1,68 @@ + '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', [ + 'code' => $this->code, + 'name' => $this->name, + 'details' => $this->details, + ]); + + if ($response->successful()) { + $this->alert('success', 'Branch saved successfully!'); + return redirect('/branches'); + } else { + $this->alert('error', 'Failed to save branch. Please try again.'); + } + } 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.add-branch')->layout('layouts.app', ['title' => $this->title]); + } +} diff --git a/app/Livewire/StationLocator/AddFuel.php b/app/Livewire/StationLocator/AddFuel.php new file mode 100644 index 0000000..0502807 --- /dev/null +++ b/app/Livewire/StationLocator/AddFuel.php @@ -0,0 +1,65 @@ + 'required|string|max:255', + ]; + + protected $messages = [ + 'name.required' => 'Fuel name is required!', + ]; + + public function mount() + { + // Initialize any default values if needed + } + + public function save() + { + $this->validate(); + + $this->loading = true; + + try { + $response = Http::post('https://api.example.com/fuels', [ + 'name' => $this->name, + ]); + + if ($response->successful()) { + $this->alert('success', 'Fuel saved successfully!'); + return redirect('/fuels'); + } else { + $this->alert('error', 'Failed to save fuel. Please try again.'); + } + } 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.add-fuel')->layout('layouts.app', ['title' => $this->title]); + } +} diff --git a/app/Livewire/StationLocator/EditStation.php b/app/Livewire/StationLocator/EditStation.php new file mode 100644 index 0000000..183e224 --- /dev/null +++ b/app/Livewire/StationLocator/EditStation.php @@ -0,0 +1,234 @@ + 'required|string|max:128', + 'location' => 'required|string|max:128', + 'map_URL' => 'required|url', + 'lat' => 'required|string', + 'long' => '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', + 'isSched' => 'required|in:0,1', + 'date' => 'required_if:isSched,1|date', + ]; + + protected $messages = [ + 'name.required' => 'Station name is required!', + 'location.required' => 'Station location is required!', + 'map_URL.required' => 'Url is required!', + 'lat.required' => 'Lat is required!', + '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!', + 'isSched.required' => 'Please select a schedule update value.', + 'date.required_if' => 'Scheduled date is required when scheduling is enabled.', + ]; + + public function mount($id) + { + $this->id = $id; + $this->fetchStation(); + $this->fetchBranches(); + $this->fetchFuels(); + } + + public function fetchStation() + { + try { + $response = Http::get("https://api.example.com/stations/{$this->id}"); + if ($response->successful()) { + $station = $response->json(); + $this->name = $station['name']; + $this->location = $station['location']; + $this->map_URL = $station['map_Url']; + $this->lat = $station['lat']; + $this->long = $station['long']; + $this->BranchId = $station['BranchId']; + $this->contact_number = explode(',', $station['contact_number']); + $this->code = $station['code']; + $this->fuels = $this->sortFuels($station['StationFuels'] ?? []); + $this->isSched = $station['Schedule'] ? 1 : 2; + $this->date = $station['Schedule']; + } else { + $this->alert('error', 'Failed to fetch station data.'); + } + } catch (\Exception $e) { + $this->alert('error', 'An error occurred: ' . $e->getMessage()); + } + } + + public function fetchBranches() + { + try { + $response = Http::get('https://api.example.com/branches/noLimit'); + if ($response->successful()) { + $this->branches = $response->json()['data'] ?? []; + } + } catch (\Exception $e) { + $this->alert('error', 'An error occurred while fetching branches.'); + } + } + + public function fetchFuels() + { + try { + $response = Http::get('https://api.example.com/fuels'); + if ($response->successful()) { + $this->fuelsData = $response->json()['data'] ?? []; + $this->newFuel = array_filter($this->fuelsData, fn($fuel) => !in_array($fuel['id'], array_column($this->fuels, 'FuelId'))); + } + } catch (\Exception $e) { + $this->alert('error', 'An error occurred while fetching fuels.'); + } + } + + public function sortFuels($fuels) + { + $sorted = array_map(function ($fuel) { + $nameParts = explode(' ', $fuel['Fuel']['name'] ?? $fuel['name']); + $val = (int) end($nameParts) ?: 0; + return ['val' => $val, 'data' => $fuel]; + }, $fuels); + + usort($sorted, fn($a, $b) => $a['val'] <=> $b['val']); + + return array_map(fn($item) => $item['data'], $sorted); + } + + public function updateFuels($price, $id, $isFuel = true) + { + $this->fuels = array_map(function ($fuel) use ($price, $id, $isFuel) { + $fuelId = $isFuel ? ($fuel['FuelId'] ?? $fuel['id']) : $fuel['id']; + if ($fuelId === $id) { + $fuel['price'] = $price; + } + return $fuel; + }, $this->fuels); + } + + public function addToStationFuel($selectedFuels) + { + $newFuels = array_filter($this->fuelsData, fn($fuel) => in_array($fuel['id'], $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'], $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(); + + if (empty($this->fuels) && $this->isSched == 1) { + $this->alert('error', 'Cannot schedule a station without fuel.'); + return; + } + + if ($this->fuels && array_filter($this->fuels, fn($fuel) => in_array($fuel['price'], [0, '0.00', '00.00', null]))) { + $this->alert('error', 'Invalid price for fuel.'); + return; + } + + $this->loading = true; + + try { + $response = Http::put("https://api.example.com/stations/{$this->id}", [ + 'name' => $this->name, + 'location' => $this->location, + 'map_Url' => $this->map_URL, + 'lat' => $this->lat, + 'long' => $this->long, + 'contact_number' => implode(',', $this->contact_number), + 'BranchId' => $this->BranchId, + 'code' => $this->code, + 'Schedule' => $this->isSched == 1 ? $this->date : null, + 'NewStationFuel' => array_map(fn($fuel) => [ + 'FuelId' => $fuel['FuelId'], + 'price' => $fuel['price'], + ], $this->fuels), + 'modified_by' => auth()->user()->name ?? 'user', // Adjust based on your auth + ]); + + if ($response->successful()) { + $this->alert('success', 'Station updated successfully!'); + return redirect('/stations'); + } else { + $this->alert('error', 'Failed to update station.'); + } + } 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('/stations'); + } + } + + public function render() + { + return view('livewire.station-locator.edit-station', [ + 'branches' => $this->branches, + 'fuelsData' => $this->fuelsData, + 'newFuel' => $this->newFuel, + ])->layout('layouts.app', ['title' => $this->title]); + } +} \ No newline at end of file diff --git a/app/Livewire/StationLocator/StationCreate.php b/app/Livewire/StationLocator/StationCreate.php new file mode 100644 index 0000000..2848a41 --- /dev/null +++ b/app/Livewire/StationLocator/StationCreate.php @@ -0,0 +1,115 @@ + 'required|string|max:128', + 'location' => 'required|string|max:128', + 'map_URL' => 'required|url', + 'lat' => 'required|string', + 'long' => 'required|string', + 'BranchId' => 'required|string', + 'contact_number' => 'required|array|min:1', + 'code' => 'required|string', + ]; + + protected $messages = [ + 'name.required' => 'Station name is required!', + 'location.required' => 'Station location is required!', + 'map_URL.required' => 'Url is required!', + 'lat.required' => 'Lat is required!', + 'long.required' => 'Long is required!', + 'BranchId.required' => 'Branch is required!', + 'contact_number.required' => 'Contact number is required!', + 'code.required' => 'Station code is required!', + ]; + + public function mount() + { + $this->fetchBranches(); + $this->fetchFuels(); + } + + public function fetchBranches() + { + $response = Http::get('https://api.example.com/branches/noLimit'); + if ($response->successful()) { + $this->branches = $response->json()['data']; + } + } + + public function fetchFuels() + { + $response = Http::get('https://api.example.com/fuels'); + if ($response->successful()) { + $this->fuelsData = $response->json()['data']; + } + } + + public function save() + { + $this->validate(); + + $this->loading = true; + + try { + $response = Http::post('https://api.example.com/stations', [ + 'name' => $this->name, + 'location' => $this->location, + 'map_URL' => $this->map_URL, + 'lat' => $this->lat, + 'long' => $this->long, + 'BranchId' => $this->BranchId, + 'contact_number' => implode(',', $this->contact_number), + 'code' => $this->code, + 'fuels' => $this->fuels, + ]); + + if ($response->successful()) { + $this->alert('success', 'Station saved successfully!'); + return redirect('/stations'); + } else { + $this->alert('error', 'Failed to save station. Please try again.'); + } + } 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('/stations'); + } + } + + public function render() + { + return view('livewire.station-locator.station-create', [ + 'branches' => $this->branches ?? [], + 'fuelsData' => $this->fuelsData ?? [], + ])->layout('layouts.app', ['title' => $this->title]); + } +} diff --git a/app/Livewire/StationLocator/StationList.php b/app/Livewire/StationLocator/StationList.php new file mode 100644 index 0000000..5c6a811 --- /dev/null +++ b/app/Livewire/StationLocator/StationList.php @@ -0,0 +1,71 @@ +fetchStations(); + } + + public function fetchStations() + { + try { + $response = Http::get('https://api.example.com/stations'); + if ($response->successful()) { + $this->stations = $response->json()['data'] ?? []; + } else { + $this->alert('error', 'Failed to fetch stations.'); + } + } 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 station?')) { + try { + $response = Http::delete("https://api.example.com/stations/{$id}"); + if ($response->successful()) { + $this->alert('success', 'Station deleted successfully!'); + $this->fetchStations(); + } else { + $this->alert('error', 'Failed to delete station.'); + } + } catch (\Exception $e) { + $this->alert('error', 'An error occurred: ' . $e->getMessage()); + } + } + } + + public function showLocation($station) + { + $this->dataLocation = $station; + $this->locationModal = true; + } + + public function toggleUploadPriceModal() + { + $this->uploadPriceModal = !$this->uploadPriceModal; + } + + public function render() + { + return view('livewire.station-locator.station-list', [ + 'stations' => $this->stations, + ])->layout('layouts.app', ['title' => 'Station List']); + } +} \ No newline at end of file diff --git a/composer.json b/composer.json index d80d8cc..4c37cdf 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,7 @@ "require": { "php": "^8.2", "guzzlehttp/guzzle": "^7.9", + "jantinnerezo/livewire-alert": "^4.0", "jenssegers/agent": "^2.6", "laravel/framework": "^11.31", "laravel/tinker": "^2.9", diff --git a/composer.lock b/composer.lock index 51cf3e6..5b9927d 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": "a76eb60c479c8d60dd14c1dc914f137b", + "content-hash": "cbf41d952611e3353e0bca416abca632", "packages": [ { "name": "brick/math", @@ -1054,6 +1054,70 @@ ], "time": "2025-02-03T10:55:03+00:00" }, + { + "name": "jantinnerezo/livewire-alert", + "version": "v4.0.4", + "source": { + "type": "git", + "url": "https://github.com/jantinnerezo/livewire-alert.git", + "reference": "c1f3477f6d22d8bb88247028c6bc97fee24a679f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jantinnerezo/livewire-alert/zipball/c1f3477f6d22d8bb88247028c6bc97fee24a679f", + "reference": "c1f3477f6d22d8bb88247028c6bc97fee24a679f", + "shasum": "" + }, + "require": { + "illuminate/support": "^10.0|^11.0|^12.0", + "livewire/livewire": "^3.0", + "php": "^8.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.70", + "orchestra/testbench": "^8.0|^9.0|^10.0", + "phpstan/phpstan": "^2.1", + "phpunit/phpunit": "^9.5|^10.0|^11.5.3" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "LivewireAlert": "Jantinnerezo\\LivewireAlert\\LivewireAlert" + }, + "providers": [ + "Jantinnerezo\\LivewireAlert\\LivewireAlertServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Jantinnerezo\\LivewireAlert\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jantinn Erezo", + "email": "erezojantinn@gmail.com", + "role": "Developer" + } + ], + "description": "This package provides a simple alert utilities for your livewire components.", + "homepage": "https://github.com/jantinnerezo/livewire-alert", + "keywords": [ + "jantinnerezo", + "livewire-alert" + ], + "support": { + "issues": "https://github.com/jantinnerezo/livewire-alert/issues", + "source": "https://github.com/jantinnerezo/livewire-alert/tree/v4.0.4" + }, + "time": "2025-03-20T06:47:20+00:00" + }, { "name": "jaybizzle/crawler-detect", "version": "v1.3.4", diff --git a/package-lock.json b/package-lock.json index 11fc1d7..2bf4a2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "packages": { "": { "dependencies": { + "@popperjs/core": "^2.11.8", "bootstrap": "^5.3.5", "bootstrap-icons": "^1.11.3", "sweetalert2": "^11.17.2" @@ -545,7 +546,6 @@ "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", - "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" diff --git a/package.json b/package.json index 1513274..6f87acb 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "vite": "^6.0.11" }, "dependencies": { + "@popperjs/core": "^2.11.8", "bootstrap": "^5.3.5", "bootstrap-icons": "^1.11.3", "sweetalert2": "^11.17.2" diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 721de20..9b62aeb 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -5,6 +5,10 @@ Unioil - @yield('title') + + + + @if(app()->environment('local')) + + + + + +
+ +
+ + @error('map_URL')
{{ $message }}
@enderror +
+
+ +
+ +
+ + @error('lat')
{{ $message }}
@enderror +
+
+ +
+ +
+ + @error('long')
{{ $message }}
@enderror +
+
+ +
+ +
+ + @error('code')
{{ $message }}
@enderror +
+
+ +
+ +
+ + @error('name')
{{ $message }}
@enderror +
+
+ +
+ +
+ + @error('location')
{{ $message }}
@enderror +
+
+ +
+ +
+ + @error('contact_number.*')
{{ $message }}
@enderror +
+
+ +
+ +
+ + @error('BranchId')
{{ $message }}
@enderror +
+
+ + +
+ +
+
+ + +
+
+ + +
+ @error('isSched')
{{ $message }}
@enderror +
+
+ + @if($isSched == 1) +
+ +
+ + @error('date')
{{ $message }}
@enderror +
+
+ @endif + + +
+ +
+ + @foreach($fuels as $index => $fuel) +
+ {{ $fuel['name'] }} + + +
+ @endforeach +
+
+ + +
+ + +
+ + + + @if($fuelModal) + + + Add Fuel + + + + + + + Close + + + Add Fuel + + + + @endif + + + @if($removeModal) + + + Remove Fuel + + +

Are you sure you want to remove {{ $fuelName }}?

+
+ + + Close + + + Remove + + +
+ @endif + + + +@endsection \ No newline at end of file diff --git a/resources/views/livewire/station-locator/station-create.blade.php b/resources/views/livewire/station-locator/station-create.blade.php new file mode 100644 index 0000000..5980d4f --- /dev/null +++ b/resources/views/livewire/station-locator/station-create.blade.php @@ -0,0 +1,122 @@ +@extends('layouts.app') + +@section('content') +
+
+
+

{{ $title }}

+
+
+
+
+ +
+ + @error('name')
{{ $message }}
@enderror +
+
+ +
+ +
+ + @error('location')
{{ $message }}
@enderror +
+
+ +
+ +
+ + @error('map_URL')
{{ $message }}
@endregion +
+
+ +
+ +
+ + @error('lat')
{{ $message }}
@endregion +
+
+ +
+ +
+ + @error('long')
{{ $message }}
@endregion +
+
+ +
+ +
+ + @error('code')
{{ $message }}
@endregion +
+
+ +
+ +
+ + @error('BranchId')
{{ $message }}
@endregion +
+
+ +
+ +
+ + @error('contact_number')
{{ $message }}
@endregion +
+
+ +
+ + +
+
+
+ + + +
+ +
+
+ + +
+
+ +
+
+@endsection \ No newline at end of file diff --git a/resources/views/livewire/station-locator/station-list.blade.php b/resources/views/livewire/station-locator/station-list.blade.php new file mode 100644 index 0000000..8f3824c --- /dev/null +++ b/resources/views/livewire/station-locator/station-list.blade.php @@ -0,0 +1,64 @@ +@extends('layouts.app') + +@section('content') +
+
+
+

Station List

+
+ + Add Station +
+
+
+ + + + + + + + + + + + + + + @forelse ($stations as $station) + + + + + + + + + + + @empty + + + + @endforelse + +
Station CodeStation NameBranch NameDate CreatedCreated ByModified ByDate ModifiedAction
{{ $station['code'] }}{{ $station['name'] }}{{ $station['Branch']['name'] ?? 'N/A' }}{{ \Carbon\Carbon::parse($station['createdAt'])->format('M d, Y H:i') }}{{ $station['created_by'] ?? 'N/A' }}{{ $station['modified_by'] ?? 'N/A' }}{{ \Carbon\Carbon::parse($station['updatedAt'])->format('M d, Y H:i') }} + + Edit + +
No stations found.
+
+
+ + +
+ + + +
+ + + + +
+@endsection \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 7cf6b79..ecb5c9d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -47,6 +47,18 @@ use App\Livewire\FetchData; use App\Livewire\Logout; use App\Livewire\ErrorHandler; +use App\Livewire\StationLocator\AddFuel; +use App\Livewire\StationLocator\AddBranch; + +use App\Livewire\StationLocator\StationList; +use App\Livewire\StationLocator\StationCreate; +use App\Livewire\StationLocator\EditStation; + +Route::get('/stations', StationList::class)->name('stations.list'); +Route::get('/stations/create', StationCreate::class)->name('stations.create'); +Route::get('/stations/view/{id}', EditStation::class)->name('stations.edit'); + + Route::middleware(['auth'])->group(function () { Route::get('/user-management', \App\Livewire\UserManagement\UserList::class)->name('user-management'); Route::get('/user-management/create', \App\Livewire\UserManagement\Create::class)->name('user-management.create'); @@ -61,15 +73,21 @@ Route::middleware(['auth'])->group(function () { Route::get('/top-up/view/{id}', \App\Livewire\TopUp\View::class)->name('top-up.view'); }); -Route::middleware(['auth'])->group(function () { - Route::get('/system-parameters', \App\Livewire\SystemPreferences\Create::class)->name('system-parameters'); -}); -Route::middleware(['auth'])->group(function () { - Route::get('/fuels', \App\Livewire\StationLocator\Fuels::class)->name('fuels'); - Route::get('/fuels/create', \App\Livewire\StationLocator\FuelCreate::class)->name('fuels.create'); - Route::get('/branches', \App\Livewire\StationLocator\Branches::class)->name('branches'); - Route::get('/branches/create', \App\Livewire\StationLocator\BranchCreate::class)->name('branches.create'); -}); +// Route::middleware(['auth'])->group(function () { +// Route::get('/system-parameters', \App\Livewire\SystemPreferences\Create::class)->name('system-parameters'); +// }); +// Route::middleware(['auth'])->group(function () { +// Route::get('/fuels', \App\Livewire\StationLocator\Fuels::class)->name('fuels'); +// Route::get('/fuels/create', \App\Livewire\StationLocator\FuelCreate::class)->name('fuels.create'); +// Route::get('/branches', \App\Livewire\StationLocator\Branches::class)->name('branches'); +// Route::get('/branches/create', \App\Livewire\StationLocator\BranchCreate::class)->name('branches.create'); +// }); + + +// Route::get('/fuels/add', AddFuel::class)->name('fuels.add'); +// Route::get('/branches/add', AddBranch::class)->name('branches.add'); + + Route::get('/change-password', \App\Livewire\ChangePassword::class)->name('change-password'); Route::get('/registration', \App\Livewire\Registration::class)->name('registration');