Lae/app/View/Components/ModuleEarning.php

38 lines
756 B
PHP
Raw Normal View History

2022-11-20 03:51:19 +00:00
<?php
namespace App\View\Components;
use App\Models\Module;
2022-12-27 16:25:22 +00:00
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
2022-11-20 03:51:19 +00:00
use Illuminate\View\Component;
class ModuleEarning extends Component
{
private Module $module;
2022-11-20 12:32:49 +00:00
2022-11-20 03:51:19 +00:00
/**
* Create a new component instance.
*
* @return void
*/
public function __construct(Module $module)
{
//
$this->module = $module;
}
/**
* Get the view / contents that represent the component.
*
2022-12-27 16:25:22 +00:00
* @return Application|Factory|View
2022-11-20 03:51:19 +00:00
*/
public function render()
{
$years = $this->module->calculate();
return view('components.module-earning', compact('years'));
}
}