Merge remote-tracking branch 'origin/main' into main_watanabe
All checks were successful
Deploy preview (main_watanabe) / deploy (push) Successful in 14s

This commit is contained in:
Yu Watanabe 2025-09-29 11:44:02 +09:00
commit d1306131cf
7 changed files with 308 additions and 3 deletions

View File

@ -0,0 +1,52 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
class UserInformationController extends Controller
{
public function index()
{
$user_id = session('user_id');
if (!$user_id) {
return redirect('/login');
}
$user_name = DB::table('user')->where('user_id', $user_id)->value('user_name');
// お知らせデータ取得
$informations = DB::table('user_information_history')
->where('user_id', $user_id)
->orderByDesc('user_information_history_id')
->select('entry_date', 'user_information_history')
->limit(10)
->get();
return view('user_information.index', [
'user_name' => $user_name, // ユーザー名(ヘッダー用)
'informations' => $informations
]);
}
public function history()
{
$user_id = session('user_id');
if (!$user_id) {
return redirect('/login');
}
$user_name = DB::table('user')->where('user_id', $user_id)->value('user_name');
// お知らせデータ取得(全件)
$informations = DB::table('user_information_history')
->where('user_id', $user_id)
->orderByDesc('user_information_history_id')
->select('entry_date', 'user_information_history')
->paginate(10);
return view('user_information.history', [
'user_name' => $user_name, // ユーザー名(ヘッダー用)
'informations' => $informations
]);
}
}

View File

@ -8,7 +8,8 @@
"require": { "require": {
"php": "^8.2", "php": "^8.2",
"laravel/framework": "^12.0", "laravel/framework": "^12.0",
"laravel/tinker": "^2.10.1" "laravel/tinker": "^2.10.1",
"simplesoftwareio/simple-qrcode": "^4.2"
}, },
"require-dev": { "require-dev": {
"fakerphp/faker": "^1.23", "fakerphp/faker": "^1.23",

174
composer.lock generated
View File

@ -4,8 +4,62 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "d8f67b824a1bf31c8999ead558d9b485", "content-hash": "2c302bf3eb129a3df792a2c53a938458",
"packages": [ "packages": [
{
"name": "bacon/bacon-qr-code",
"version": "2.0.8",
"source": {
"type": "git",
"url": "https://github.com/Bacon/BaconQrCode.git",
"reference": "8674e51bb65af933a5ffaf1c308a660387c35c22"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/8674e51bb65af933a5ffaf1c308a660387c35c22",
"reference": "8674e51bb65af933a5ffaf1c308a660387c35c22",
"shasum": ""
},
"require": {
"dasprid/enum": "^1.0.3",
"ext-iconv": "*",
"php": "^7.1 || ^8.0"
},
"require-dev": {
"phly/keep-a-changelog": "^2.1",
"phpunit/phpunit": "^7 | ^8 | ^9",
"spatie/phpunit-snapshot-assertions": "^4.2.9",
"squizlabs/php_codesniffer": "^3.4"
},
"suggest": {
"ext-imagick": "to generate QR code images"
},
"type": "library",
"autoload": {
"psr-4": {
"BaconQrCode\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Ben Scholzen 'DASPRiD'",
"email": "mail@dasprids.de",
"homepage": "https://dasprids.de/",
"role": "Developer"
}
],
"description": "BaconQrCode is a QR code generator for PHP.",
"homepage": "https://github.com/Bacon/BaconQrCode",
"support": {
"issues": "https://github.com/Bacon/BaconQrCode/issues",
"source": "https://github.com/Bacon/BaconQrCode/tree/2.0.8"
},
"time": "2022-12-07T17:46:57+00:00"
},
{ {
"name": "brick/math", "name": "brick/math",
"version": "0.13.1", "version": "0.13.1",
@ -135,6 +189,56 @@
], ],
"time": "2024-02-09T16:56:22+00:00" "time": "2024-02-09T16:56:22+00:00"
}, },
{
"name": "dasprid/enum",
"version": "1.0.7",
"source": {
"type": "git",
"url": "https://github.com/DASPRiD/Enum.git",
"reference": "b5874fa9ed0043116c72162ec7f4fb50e02e7cce"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/DASPRiD/Enum/zipball/b5874fa9ed0043116c72162ec7f4fb50e02e7cce",
"reference": "b5874fa9ed0043116c72162ec7f4fb50e02e7cce",
"shasum": ""
},
"require": {
"php": ">=7.1 <9.0"
},
"require-dev": {
"phpunit/phpunit": "^7 || ^8 || ^9 || ^10 || ^11",
"squizlabs/php_codesniffer": "*"
},
"type": "library",
"autoload": {
"psr-4": {
"DASPRiD\\Enum\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Ben Scholzen 'DASPRiD'",
"email": "mail@dasprids.de",
"homepage": "https://dasprids.de/",
"role": "Developer"
}
],
"description": "PHP 7.1 enum implementation",
"keywords": [
"enum",
"map"
],
"support": {
"issues": "https://github.com/DASPRiD/Enum/issues",
"source": "https://github.com/DASPRiD/Enum/tree/1.0.7"
},
"time": "2025-09-16T12:23:56+00:00"
},
{ {
"name": "dflydev/dot-access-data", "name": "dflydev/dot-access-data",
"version": "v3.0.3", "version": "v3.0.3",
@ -3271,6 +3375,74 @@
}, },
"time": "2025-06-25T14:20:11+00:00" "time": "2025-06-25T14:20:11+00:00"
}, },
{
"name": "simplesoftwareio/simple-qrcode",
"version": "4.2.0",
"source": {
"type": "git",
"url": "https://github.com/SimpleSoftwareIO/simple-qrcode.git",
"reference": "916db7948ca6772d54bb617259c768c9cdc8d537"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/SimpleSoftwareIO/simple-qrcode/zipball/916db7948ca6772d54bb617259c768c9cdc8d537",
"reference": "916db7948ca6772d54bb617259c768c9cdc8d537",
"shasum": ""
},
"require": {
"bacon/bacon-qr-code": "^2.0",
"ext-gd": "*",
"php": ">=7.2|^8.0"
},
"require-dev": {
"mockery/mockery": "~1",
"phpunit/phpunit": "~9"
},
"suggest": {
"ext-imagick": "Allows the generation of PNG QrCodes.",
"illuminate/support": "Allows for use within Laravel."
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
"QrCode": "SimpleSoftwareIO\\QrCode\\Facades\\QrCode"
},
"providers": [
"SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"SimpleSoftwareIO\\QrCode\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Simple Software LLC",
"email": "support@simplesoftware.io"
}
],
"description": "Simple QrCode is a QR code generator made for Laravel.",
"homepage": "https://www.simplesoftware.io/#/docs/simple-qrcode",
"keywords": [
"Simple",
"generator",
"laravel",
"qrcode",
"wrapper"
],
"support": {
"issues": "https://github.com/SimpleSoftwareIO/simple-qrcode/issues",
"source": "https://github.com/SimpleSoftwareIO/simple-qrcode/tree/4.2.0"
},
"time": "2021-02-08T20:43:55+00:00"
},
{ {
"name": "symfony/clock", "name": "symfony/clock",
"version": "v7.3.0", "version": "v7.3.0",

View File

@ -50,7 +50,7 @@
</div> </div>
<div class="col-6 col-md-2 mb20"> <div class="col-6 col-md-2 mb20">
<div class="card text-center border-success"> <div class="card text-center border-success">
<a href="{{ url('SWC-15-1.html') }}" target="_top"> <a href="{{ url('/user_information') }}" target="_top">
<figure><img src="{{ asset('assets/img/menu-tuuchi.png') }}" alt="" class="w-75 mt10"></figure> <figure><img src="{{ asset('assets/img/menu-tuuchi.png') }}" alt="" class="w-75 mt10"></figure>
<p class="text-success">お知らせ一覧</p> <p class="text-success">お知らせ一覧</p>
</a> </a>

View File

@ -0,0 +1,37 @@
@extends('layouts.app')
@section('content')
<main>
<header class="alert alert-success">
<h4 class="container">お知らせ > 過去のお知らせ</h4>
</header>
<section id="" class="container mt30 mb50">
<div class="col-12 col-md-8 offset-0 offset-md-2 mb30">
<h3 class="text-center alert-success">お知らせ一覧</h3>
</div>
<div class="row">
@forelse($informations as $information)
<div class="col-12 col-md-3 offset-0 offset-md-2">
<h5 class="text-success">
{{ \Carbon\Carbon::parse($information->entry_date)->format('Y年n月j日') }}
</h5>
</div>
<div class="col-12 col-lg-7 mb10">
<p class="h5 font-weight-normal">
{{ $information->user_information_history }}
</p>
</div>
@empty
<div class="col-12 text-center py-5">
<p>過去のお知らせはありません。</p>
</div>
@endforelse
</div>
<div class="d-flex justify-content-center mt-4">
{{ $informations->links('partials.paging') }}
</div>
<div class="col-12 col-md-6 offset-0 offset-md-3 mt-4 mb50">
<a href="{{ url('mypage') }}" class="btn btn-lg btn-block btn-outline-success">マイページへ戻る</a>
</div>
</section>
</main>
@endsection

View File

@ -0,0 +1,38 @@
@extends('layouts.app')
@section('content')
<main>
<header class="alert alert-success">
<h4 class="container">お知らせ > お知らせ一覧</h4>
</header>
<section id="" class="container mt30 mb50">
<div class="col-12 col-md-8 offset-0 offset-md-2 mb30">
<h3 class="text-center alert-success">お知らせ一覧</h3>
</div>
<div class="row">
@forelse($informations as $information)
<div class="col-12 col-md-3 offset-0 offset-md-2">
<h5 class="text-success">
{{ \Carbon\Carbon::parse($information->entry_date)->format('Y年n月j日') }}
</h5>
</div>
<div class="col-12 col-lg-7 mb10">
<p class="h5 font-weight-normal">
{{ $information->user_information_history }}
</p>
</div>
@empty
<div class="col-12 text-center py-5">
<p>お知らせはありません。</p>
</div>
@endforelse
<div class="col-12 col-md-5 offset-md-1 mt10">
<a href="{{ url('mypage') }}" class="btn btn-lg btn-block btn-outline-success">マイページへ戻る</a>
</div>
<div class="col-12 col-md-5 mt10">
<a href="{{ url('user_information/history') }}" class="btn btn-lg btn-block btn-outline-success">過去のお知らせ</a>
</div>
</div>
</section>
</main>
@endsection

View File

@ -22,6 +22,7 @@ use App\Http\Controllers\ParkingSearchController;
use App\Http\Controllers\ParkWaitlistController; use App\Http\Controllers\ParkWaitlistController;
use App\Http\Controllers\ReceiptController; use App\Http\Controllers\ReceiptController;
use App\Http\Controllers\ParkDetailController; use App\Http\Controllers\ParkDetailController;
use App\Http\Controllers\UserInformationController;
// 画面遷移のみ // 画面遷移のみ
Route::get('/', function () { return view('general.swo1_1'); })->name('swo1_1'); Route::get('/', function () { return view('general.swo1_1'); })->name('swo1_1');
@ -133,6 +134,10 @@ Route::get('park_search', [RegularContractCreateController::class, 'show'])->nam
// 空き待ち状況確認 // 空き待ち状況確認
Route::get('park_waitlist', [ParkWaitlistController::class, 'index'])->name('park_waitlist.index'); Route::get('park_waitlist', [ParkWaitlistController::class, 'index'])->name('park_waitlist.index');
// 会員へのお知らせ
Route::get('/user_information', [UserInformationController::class, 'index'])->name('user_information.index');
Route::get('/user_information/history', [UserInformationController::class, 'history'])->name('user_information.history');
// ウェルネット決済画面(仮) // ウェルネット決済画面(仮)
Route::get('/wellnet/payment', function (): mixed { Route::get('/wellnet/payment', function (): mixed {
$html = <<<HTML $html = <<<HTML