34 lines
902 B
PHP
Executable File
34 lines
902 B
PHP
Executable File
<?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);
|
|
}
|
|
|
|
|
|
}
|
|
|