generated from astrogoat/app-skeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
367 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
database/migrations/2023_05_17_000020_create_pamtechoga_zones_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class CreatePamtechogaZonesTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('pamtechoga_zones', function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->string('name'); | ||
$table->boolean('is_deleted')->default(false); | ||
$table->dateTime('created_at')->nullable(); | ||
$table->dateTime('updated_at')->nullable(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('pamtechoga_reviews'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<x-fab::layouts.page | ||
:title="$model?->name ?: 'Untitled'" | ||
:breadcrumbs="[ | ||
['title' => 'Home', 'url' => route('lego.dashboard')], | ||
['title' => 'Zones', 'url' => route('lego.pamtechoga.zones.index')], | ||
['title' => $model?->name ?: 'Untitled'], | ||
]" | ||
x-data="" | ||
x-on:keydown.meta.s.window.prevent="$wire.call('save')" {{-- For Mac --}} | ||
x-on:keydown.ctrl.s.window.prevent="$wire.call('save')" {{-- For PC --}} | ||
> | ||
<x-slot name="actions"> | ||
@include('lego::models._includes.forms.page-actions') | ||
</x-slot> | ||
<x-lego::feedback.errors class="sh-mb-4" /> | ||
|
||
<x-fab::layouts.main-with-aside> | ||
<x-fab::layouts.panel> | ||
|
||
<x-fab::forms.input | ||
wire:model="model.name" | ||
label="Zone name" | ||
help="This is the name of the zone." | ||
/> | ||
|
||
</x-fab::layouts.panel> | ||
|
||
<x-fab::layouts.panel | ||
title="Stations" | ||
description="Below are the stations in this zone." | ||
class="sh-mt-4" | ||
> | ||
<x-fab::lists.stacked | ||
> | ||
@foreach($this->model->stations as $data) | ||
<div | ||
x-sortable.products.item="{{ $data->id }}" | ||
> | ||
<x-fab::lists.stacked.grouped-with-actions | ||
:title="$data?->company_name" | ||
description="{{ $data->updated_at->toFormattedDateString() }}" | ||
> | ||
<x-slot name="avatar"> | ||
<div class="flex"> | ||
<x-fab::elements.icon icon="dots-vertical" x-sortable.products.handle | ||
class="sh-h-5 sh-w-5 sh-text-gray-300 sh--mr-2"/> | ||
<x-fab::elements.icon icon="dots-vertical" x-sortable.products.handle | ||
class="sh-h-5 sh-w-5 sh-text-gray-300 sh--ml-1.5"/> | ||
</div> | ||
</x-slot> | ||
<x-slot name="actions"> | ||
<x-fab::elements.button | ||
size="xs" | ||
type="link" | ||
:url="route('lego.pamtechoga.fuel-prices.edit', $data)" | ||
> | ||
View | ||
</x-fab::elements.button> | ||
</x-slot> | ||
</x-fab::lists.stacked.grouped-with-actions> | ||
</div> | ||
@endforeach | ||
</x-fab::lists.stacked> | ||
</x-fab::layouts.panel> | ||
|
||
<x-slot name="aside"> | ||
@include('pamtechoga::models.components.timestamp') | ||
</x-slot> | ||
|
||
</x-fab::layouts.main-with-aside> | ||
</x-fab::layouts.page> | ||
|
||
@push('styles') | ||
<link href="{{ asset('vendor/pamtechoga/css/pamtechoga.css') }}" rel="stylesheet"> | ||
@endpush |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<x-fab::layouts.page | ||
title="Zones" | ||
:breadcrumbs="[ | ||
['title' => 'Home', 'url' => route('lego.dashboard')], | ||
['title' => 'Zones','url' => route('lego.pamtechoga.zones.index')], | ||
]" | ||
x-data="{ showColumnFilters: false }" | ||
> | ||
<x-slot name="actions"> | ||
<x-fab::elements.button type="link" :url="route('lego.pamtechoga.zones.create')">Create</x-fab::elements.button> | ||
</x-slot> | ||
|
||
@include('lego::models._includes.indexes.filters') | ||
|
||
<x-fab::lists.table> | ||
<x-slot name="headers"> | ||
@include('lego::models._includes.indexes.headers') | ||
<x-fab::lists.table.header :hidden="true">Edit</x-fab::lists.table.header> | ||
</x-slot> | ||
|
||
@include('lego::models._includes.indexes.header-filters') | ||
<x-fab::lists.table.header x-show="showColumnFilters" x-cloak class="bg-gray-100" /> | ||
|
||
@foreach($models as $data) | ||
<x-fab::lists.table.row :odd="$loop->odd"> | ||
@if($this->shouldShowColumn('name')) | ||
<x-fab::lists.table.column primary full> | ||
<a href="{{ route('lego.pamtechoga.zones.edit', $data) }}">{{ $data->name }} ({{ count($data->stations) }} stations)</a> | ||
</x-fab::lists.table.column> | ||
@endif | ||
|
||
@if($this->shouldShowColumn('updated_at')) | ||
<x-fab::lists.table.column align="right"> | ||
{{ $data->updated_at->toFormattedDateString() }} | ||
</x-fab::lists.table.column> | ||
@endisset | ||
|
||
<x-fab::lists.table.column align="right" slim> | ||
<a href="{{ route('lego.pamtechoga.zones.edit', $data) }}">Edit</a> | ||
</x-fab::lists.table.column> | ||
</x-fab::lists.table.row> | ||
@endforeach | ||
</x-fab::lists.table> | ||
|
||
@include('lego::models._includes.indexes.pagination') | ||
</x-fab::layouts.page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Vibraniuum\Pamtechoga\Http\Livewire; | ||
|
||
use Helix\Lego\Http\Livewire\Models\Form; | ||
use Vibraniuum\Pamtechoga\Models\Zone; | ||
|
||
class ZonesForm extends Form | ||
{ | ||
protected bool $canBeViewed = false; | ||
|
||
public function rules() | ||
{ | ||
return [ | ||
'model.name' => 'required', | ||
]; | ||
} | ||
|
||
public function mount($zone = null) | ||
{ | ||
$this->setModel($zone); | ||
} | ||
|
||
public function view() | ||
{ | ||
return 'pamtechoga::models.zones.form'; | ||
} | ||
|
||
public function model(): string | ||
{ | ||
return Zone::class; | ||
} | ||
} |
Oops, something went wrong.