You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?php
namespace App\Models;
use App\Presenters\InventoryOutProductPresenter;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Laracasts\Presenter\PresentableTrait;
class InventoryOutProduct extends Model
{
use HasFactory,PresentableTrait;
protected $presenter = InventoryOutProductPresenter::class;
}
My Presenter :
<?php
namespace App\Presenters;
use Laracasts\Presenter\Presenter;
class InventoryOutProductPresenter extends Presenter {
public function product_text_format()
{
return $this->title.'('.$this->price_per_qty.')';
}
}
Call : $model->present()->product_text_format;
The text was updated successfully, but these errors were encountered:
My Model :
My Presenter :
Call : $model->present()->product_text_format;
The text was updated successfully, but these errors were encountered: