Lae/app/View/Components/ModuleEarning.php

34 lines
654 B
PHP
Raw Normal View History

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