Which one please?

|
lonelyyAstronaut 2022-08-28 14:49:56
Jonathan Antunes 2022-08-28 14:49:44
Do you need the withQueryString()?

yes am implementing a filter search

Jonathan Antunes 2022-08-28 14:50:05
And if you removed this fuction
lonelyyAstronaut 2022-08-28 14:51:10
then i dont have the query variables for the filter and my database query will fail
Kymfyy 2022-08-28 14:51:29
Eddie Adelmar 2022-08-28 09:59:30
I need an app that can connect sell & buyer especially farmers

Something like a classified ads for farmers

Jonathan Antunes 2022-08-28 14:53:26
lonelyyAstronaut 2022-08-28 14:51:10
then i dont have the query variables for the filter and my database query will fail

Can you show the entire method?

lonelyyAstronaut 2022-08-28 14:53:59
laravel_discuss-135798.jpg

Jonathan Antunes 2022-08-28 14:56:04
The variable $keys received the $request->query()?
lonelyyAstronaut 2022-08-28 15:02:14
Jonathan Antunes 2022-08-28 14:56:04
The variable $keys received the $request->query()?

yes it does recieve it

lonelyyAstronaut 2022-08-28 15:02:44
the problem is one of the keys is page=2 which i think the paginator is sending and that’s not part of my column hence the exception
lonelyyAstronaut 2022-08-28 15:15:01
let me try that
lonelyyAstronaut 2022-08-28 15:18:31
this way no query strings are passed along the paginator so query fails
lonelyyAstronaut 2022-08-28 15:20:07
laravel_discuss-135810.jpg

lonelyyAstronaut 2022-08-28 15:20:33
laravel_discuss-135812.jpg

lonelyyAstronaut 2022-08-28 15:20:48
this the keys variable data
lonelyyAstronaut 2022-08-28 15:20:59
no query strings passed
lonelyyAstronaut 2022-08-28 15:21:19
yeah
lonelyyAstronaut 2022-08-28 15:25:11
okay wait
lonelyyAstronaut 2022-08-28 15:30:15
the problem still persists
lonelyyAstronaut 2022-08-28 15:30:28
laravel_discuss-135821.jpg

lonelyyAstronaut 2022-08-28 15:30:39
this is the value for $keys
lonelyyAstronaut 2022-08-28 15:30:56
as you can see the last entry is the page value
lonelyyAstronaut 2022-08-28 15:34:03
yeah i have a couple of other tables with other implementation so i would have to do this over there too i think this works thanks
namdi 2022-08-28 16:17:43
Hello,

Who has used AWS Simple Email service to send email from Laravel built API in a production environment.

Denno_IT 2022-08-28 16:29:42
can someone help me… what is the issue with my controller
Denno_IT 2022-08-28 16:31:43
laravel_discuss-135836.jpg

Denno_IT 2022-08-28 16:32:29
laravel_discuss-135837.jpg
this is my controller
Denno_IT 2022-08-28 16:33:34
public function store(Request $request)
{
//return $request->all();

DB::transaction(function() use($request){
//i will use the order model here
$orders = new Order;
$orders->name = $request->customer_name;
$orders->phone = $request->customer_phone;
$orders->save();
$order_id = $orders->id;

//i will use order details model here
for($product_id = 0; $product_id<count($request->product_id); $product_id++){
//i will use the transaction model here
$transaction = new Transaction();

$transaction->order_id =$order_id;
$transaction->user_id = auth()->user()->id;

$transaction->balance =$request->balance;
$transaction->paid_amount =$request->paid_amount;
$transaction->payment_method =$request->payment_method;
$transaction->transact_amount =$order_details->amount;
$transaction->transact_date=date(‘Y-m-d’);
$transaction->save();

//i have to place the order History here.
$products= Product::all();
$order_details= Order_Detail::where(‘order_id’, $order_id)->get();
$orderedBy = Order::where(‘id’, $order_id)->get();

return view(‘orders.index’, [
‘products’=> $products,
‘order_details’=>$order_details,
‘customer_orders’=>$orderedBy
]);

// where are yo reading from javarascript?

}

Denno_IT 2022-08-28 16:33:45
Denno_IT 2022-08-28 16:33:34
public function store(Request $request)
{
//return $request->all();

DB::transaction(function() use($request){
//i will use the order model here
$orders = new Order;
$orders->name = $request->customer_name;
$orders->phone = $request->customer_phone;
$orders->save();
$order_id = $orders->id;

//i will use order details model here
for($product_id = 0; $product_id<count($request->product_id); $product_id++){
//i will use the transaction model here
$transaction = new Transaction();

$transaction->order_id =$order_id;
$transaction->user_id = auth()->user()->id;

$transaction->balance =$request->balance;
$transaction->paid_amount =$request->paid_amount;
$transaction->payment_method =$request->payment_method;
$transaction->transact_amount =$order_details->amount;
$transaction->transact_date=date(‘Y-m-d’);
$transaction->save();

//i have to place the order History here.
$products= Product::all();
$order_details= Order_Detail::where(‘order_id’, $order_id)->get();
$orderedBy = Order::where(‘id’, $order_id)->get();

return view(‘orders.index’, [
‘products’=> $products,
‘order_details’=>$order_details,
‘customer_orders’=>$orderedBy
]);

// where are yo reading from javarascript?

}

this is my controller

Denno_IT 2022-08-28 16:34:04
i dont see any error but it returns and error
faissaloux 2022-08-28 16:36:06
Can you please take screeenshot of the whole controller
Denno_IT 2022-08-28 16:37:04
faissaloux 2022-08-28 16:36:06
Can you please take screeenshot of the whole controller

okay

faissaloux 2022-08-28 16:39:07
No not just 75 screenshot everything
Denno_IT 2022-08-28 16:39:12
laravel_discuss-135845.jpg

faissaloux 2022-08-28 16:39:20
I think the error is after that function
Denno_IT 2022-08-28 16:39:34
faissaloux 2022-08-28 16:39:20
I think the error is after that function

which one please??

|