Files
boursecu_server/app/Http/Controllers/Customer/PriceTriggerController.php
T
2026-02-16 09:29:37 +00:00

34 lines
902 B
PHP

<?php
namespace App\Http\Controllers\Customer;
use App\Http\Controllers\SuperController;
use Illuminate\Http\Request;
use App\Models\PriceTrigger; // اطمینان حاصل کنید که این مدل به درستی وارد شده است
class PriceTriggerController extends SuperController
{
public function __construct(Request $request)
{
$request->request->add(['customer_id'=>auth('customer')->id()]);
$model = PriceTrigger::class;
$this->with = ['customer'];
$this->select = ['*'];
$this->search = ['*'];
parent::__construct($model, $this->with, $this->select);
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\JsonResponse
*/
public function index()
{
$data=PriceTrigger::where("customer_id",auth()->id())->get();
return response()->json($data);
}
}