diff --git a/app/Http/Controllers/Customers/ProjectsController.php b/app/Http/Controllers/Customers/ProjectsController.php new file mode 100644 index 0000000..2430c93 --- /dev/null +++ b/app/Http/Controllers/Customers/ProjectsController.php @@ -0,0 +1,21 @@ + + */ +class ProjectsController extends Controller +{ + public function index(Customer $customer) + { + $projects = $customer->projects; + + return view('customers.projects', compact('customer', 'projects')); + } +} diff --git a/resources/lang/en/customer.php b/resources/lang/en/customer.php index ef3617d..4275879 100644 --- a/resources/lang/en/customer.php +++ b/resources/lang/en/customer.php @@ -30,4 +30,7 @@ return [ 'description' => 'Customer Description', 'pic' => 'PIC', 'projects_count' => 'Projects count', + + // Relations + 'projects' => 'Project List', ]; diff --git a/resources/lang/id/customer.php b/resources/lang/id/customer.php index 5364599..411342b 100644 --- a/resources/lang/id/customer.php +++ b/resources/lang/id/customer.php @@ -30,4 +30,7 @@ return [ 'description' => 'Deskripsi Customer', 'pic' => 'PIC', 'projects_count' => 'Jml Project', + + // Relations + 'projects' => 'List Project', ]; diff --git a/resources/views/customers/partials/nav-tabs.blade.php b/resources/views/customers/partials/nav-tabs.blade.php index 0e0abe1..89ca29f 100644 --- a/resources/views/customers/partials/nav-tabs.blade.php +++ b/resources/views/customers/partials/nav-tabs.blade.php @@ -3,5 +3,8 @@
| {{ trans('app.table_no') }} | +{{ trans('project.name') }} | +{{ trans('project.start_date') }} | +{{ trans('project.work_duration') }} | +{{ trans('project.project_value') }} | +{{ trans('app.status') }} | +{{ trans('app.action') }} | + + + @forelse($projects as $key => $project) +
|---|---|---|---|---|---|---|
| {{ 1 + $key }} | +{{ $project->nameLink() }} | +{{ $project->start_date }} | +{{ $project->present()->workDuration }} | +{{ formatRp($project->project_value) }} | +{{ $project->present()->status }} | ++ {!! html_link_to_route('projects.show', '', [$project->id], ['icon' => 'search', 'class' => 'btn btn-info btn-xs', 'title' => trans('app.show')]) !!} + {!! html_link_to_route('projects.edit', '', [$project->id], ['icon' => 'edit', 'class' => 'btn btn-warning btn-xs', 'title' => trans('app.edit')]) !!} + | +
| {{ $status }} {{ trans('project.not_found') }} | +||||||