diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php
index 4c5d1c3..8632681 100644
--- a/app/Http/Controllers/ProjectController.php
+++ b/app/Http/Controllers/ProjectController.php
@@ -14,7 +14,7 @@ private function createOrEdit(Project $project)
{
$statuses = __('enums.project_status');
$clients = Client::all()->pluck('name', 'id');
- $projects = collect(['' => '無'])->merge(Project::all()->pluck('title', 'id'));
+ $projects = collect(['' => '無'])->union(Project::all()->pluck('title', 'id'));
return view('project.edit', ['project' => $project, 'projectStatuses' => $statuses, 'clients' => $clients, 'projects' => $projects]);
}
@@ -34,8 +34,7 @@ public function index(Request $request)
$builder->where('client_id', $clientId);
}
$projects = $builder->get();
- $statuses[''] = '所有狀態';
- $statuses += __('enums.project_status');
+ $statuses = collect(['' => '所有狀態'])->union(__('enums.project_status'));
return view('project.index', ['projects' => $projects, 'statuses' => $statuses]);
}
diff --git a/resources/views/client/view.blade.php b/resources/views/client/view.blade.php
index 7bfc249..33010f7 100644
--- a/resources/views/client/view.blade.php
+++ b/resources/views/client/view.blade.php
@@ -2,36 +2,39 @@
@section('content')
-
+
- 名稱
-
-
- {{ $client->name }}
-
-
-
-
-
-
-
+
+
| 名稱 |
- 金額 |
+ {{ $client->name }} |
-
-
- @foreach($client->projects as $project)
- | {{ $project->title }} |
- {{ $project->price }} |
+ 專案
+
+
+
+ |
+
+
+
+
+ | 名稱 |
+ 金額 |
+
+
+
+ @foreach($client->projects as $project)
+
+ | {{ $project->title }} |
+ {{ $project->price }} |
+
+ @endforeach
+
+
+ |
- @endforeach
diff --git a/resources/views/project/view.blade.php b/resources/views/project/view.blade.php
index dc313f5..7f05a1c 100644
--- a/resources/views/project/view.blade.php
+++ b/resources/views/project/view.blade.php
@@ -1,120 +1,78 @@
@extends('layouts.app')
@section('content')
-
-
-
-
-
- 名稱
-
-
- {{ $project->title }}
-
-
-
-
- 狀態
-
-
- {{ __('enums.project_status.' . $project->status) }}
-
-
-
-
- 客戶
-
-
- {{ $project->client->name }}
-
-
-
-
- 描述
-
-
- {!! nl2br($project->description) !!}
-
-
-
-
- 起始日
-
-
- {{ $project->begin_at }}
-
-
-
-
- 結束日
-
-
- {{ $project->end_at }}
-
-
-
-
- 金額
-
-
- {{ $project->price }}
-
-
-
-
- 建立日期
-
-
- {{ $project->created_at }}
-
-
-
-
- 更新日期
-
-
- {{ $project->updated_at }}
-
-
-
-
- 未收款項
-
-
- @if($project->unpaid_amount) {{ $project->unpaid_amount }} @endif
-
-
-
-
-
-
-
-
- | 類型 |
- 金額 |
- 日期 |
-
-
-
- @foreach($project->payments as $payment)
-
- | {{ __('enums.payment_type.' . $payment->type) }} |
- {{ $payment->amount }} |
- {{ $payment->created_at }} |
-
- @endforeach
-
-
-
-
-
+
+
+
+
+
+
+ | 名稱 |
+ {{ $project->title }} |
+
+
+ | 狀態 |
+ {{ __('enums.project_status.' . $project->status) }} |
+
+
+ | 客戶 |
+ {{ $project->client->name }} |
+
+
+ | 描述 |
+ {!! nl2br($project->description) !!} |
+
+
+ | 起始日 |
+ {{ $project->begin_at }} |
+
+
+ | 結束日 |
+ {{ $project->end_at }} |
+
+
+ | 金額 |
+ {{ $project->price }} |
+
+
+ | 建立日期 |
+ {{ $project->created_at }} |
+
+
+ | 更新日期 |
+ {{ $project->updated_at }} |
+
+
+ | 未收款項 |
+ @if($project->unpaid_amount) {{ $project->unpaid_amount }} @endif |
+
+
+ | 已收款項 |
+
+
+
+
+ | 類型 |
+ 金額 |
+ 日期 |
+
+
+
+ @foreach($project->payments as $payment)
+
+ | {{ __('enums.payment_type.' . $payment->type) }} |
+ {{ $payment->amount }} |
+ {{ $payment->created_at }} |
+
+ @endforeach
+
+
+ |
+
+
+
-
@endsection