This commit is contained in:
parent
041bef0546
commit
3188276fe5
30
app/Models/ParkingRegulation.php
Normal file
30
app/Models/ParkingRegulation.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class ParkingRegulation extends Model
|
||||||
|
{
|
||||||
|
// テーブル名
|
||||||
|
protected $table = 'parking_regulations';
|
||||||
|
|
||||||
|
// プライマリキー
|
||||||
|
protected $primaryKey = 'parking_regulations_seq';
|
||||||
|
|
||||||
|
// 自動インクリメントが有効
|
||||||
|
public $incrementing = true;
|
||||||
|
|
||||||
|
// タイムスタンプ自動管理
|
||||||
|
public $timestamps = true;
|
||||||
|
|
||||||
|
// マスアサイン可能カラム
|
||||||
|
protected $fillable = [
|
||||||
|
'park_id',
|
||||||
|
'psection_id',
|
||||||
|
'ptype_id',
|
||||||
|
'regulations_text',
|
||||||
|
];
|
||||||
|
|
||||||
|
// 必要ならリレーションを追加(Park / Psection / Ptype がある場合)
|
||||||
|
}
|
||||||
@ -32,7 +32,7 @@
|
|||||||
@include('admin.parking_regulations._form', ['psections' => $psections, 'ptypes' => $ptypes, 'parkId' => $parkId, 'record' => null])
|
@include('admin.parking_regulations._form', ['psections' => $psections, 'ptypes' => $ptypes, 'parkId' => $parkId, 'record' => null])
|
||||||
|
|
||||||
<div class="text-end">
|
<div class="text-end">
|
||||||
<button type="submit" class="btn btn-primary">登録</button>
|
<button type="button" class="btn btn-primary register">登録</button>
|
||||||
<a href="{{ route('parking_regulations_list', ['park_id' => $parkId]) }}" class="btn btn-default">戻る</a>
|
<a href="{{ route('parking_regulations_list', ['park_id' => $parkId]) }}" class="btn btn-default">戻る</a>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -27,16 +27,25 @@
|
|||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form method="POST" action="{{ route('parking_regulations_update', ['seq' => $record->parking_regulations_seq]) }}">
|
<!-- 登録フォーム -->
|
||||||
|
<form id="form_edit" method="POST" action="{{ route('parking_regulations_update', ['seq' => $record->parking_regulations_seq]) }}">
|
||||||
@csrf
|
@csrf
|
||||||
@include('admin.parking_regulations._form', ['psections' => $psections, 'ptypes' => $ptypes, 'parkId' => $park->park_id, 'record' => $record])
|
@include('admin.parking_regulations._form', ['psections' => $psections, 'ptypes' => $ptypes, 'parkId' => $park->park_id, 'record' => $record])
|
||||||
|
|
||||||
<div class="text-end">
|
<div class="text-end">
|
||||||
<button type="submit" class="btn btn-success">登録</button>
|
<button type="button" id="register_edit" class="btn btn-success">登録</button>
|
||||||
<button type="submit" class="btn btn-danger" onclick="return confirm('削除してよいですか?')">削除</button>
|
|
||||||
<a href="{{ route('parking_regulations_list', ['park_id' => $park->park_id]) }}" class="btn btn-secondary">戻る</a>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<!-- 削除フォーム -->
|
||||||
|
<form id="form_delete" method="POST" action="{{ route('parking_regulations_delete') }}" style="display:inline">
|
||||||
|
@csrf
|
||||||
|
<input type="hidden" name="parking_regulations_seq" value="{{ $record->parking_regulations_seq }}">
|
||||||
|
<button type="button" id="delete_edit" class="btn btn-danger">削除</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<a href="{{ route('parking_regulations_list', ['park_id' => $park->park_id]) }}" class="btn btn-secondary">戻る</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -80,17 +80,16 @@
|
|||||||
<tbody style="background:#fff;">
|
<tbody style="background:#fff;">
|
||||||
@forelse($regulations as $r)
|
@forelse($regulations as $r)
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td class="text-center align-middle">
|
||||||
<a href="{{ route('parking_regulations_edit', ['seq' => $r->parking_regulations_seq]) }}" class="btn btn-sm btn-outline-primary">編集</a>
|
<a href="{{ route('parking_regulations_edit', ['seq' => $r->parking_regulations_seq]) }}" class="btn btn-sm btn-outline-primary">編集</a>
|
||||||
<form method="POST" action="{{ route('parking_regulations_delete') }}" style="display:inline">
|
<form method="POST" action="{{ route('parking_regulations_delete') }}" style="display:inline">
|
||||||
@csrf
|
@csrf
|
||||||
<input type="hidden" name="parking_regulations_seq" value="{{ $r->parking_regulations_seq }}">
|
<input type="hidden" name="parking_regulations_seq" value="{{ $r->parking_regulations_seq }}">
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ $r->psection_subject ?? $r->psection_id }}</td>
|
<td>{{ $r->psection_subject ?? $r->psection_id }}</td>
|
||||||
<td>{{ $r->ptype_subject ?? $r->ptype_id }}</td>
|
<td>{{ $r->ptype_subject ?? $r->ptype_id }}</td>
|
||||||
<td>{{ Str::limit($r->regulations_text ?? '', 200) }}</td>
|
<td class="regulations-html">{!! $r->regulations_text !!}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@empty
|
@empty
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user