我想获取一条消息,该消息已通过larevel view return with方法返回,但是当我获取此消息变量时,它不会显示。
我已经创建了用于paytm paymentgetway的API。
web.php
Route::get('/book/{id}/{title?}','BooksController@bookDetail');
api.php
Route::post('payment/status', 'OrderController@paymentCallback');
namespace App\Http\Controllers;
use PaytmWallet;
use Illuminate\Http\Request;
use App\EventRegistration;
use Session;
use Illuminate\Support\Facades\DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use View;
use Cookie;
use URL;
public function paymentCallback(Request $request)
{
$data = Session::all();
$transaction = PaytmWallet::with('receive');
$response = $transaction->response();
$order_id = $transaction->getOrderId();
$resultsdata = DB::select('select * from tbl_payment where order_id = "'.$order_id.'"');
$msg = "";
if($transaction->isSuccessful()){
$aUpdate = DB::table('tbl_payment')->where('order_id',$transaction->getOrderId())->update(['payment_status'=>"success"]);
$currentDate = date("Y-m-d H:i:s");
// $userid = Session::get('userId');
// $ebook_id = Session::get('ebook_id');
// $payment_id = Session::get('payment_id');
DB::table('mb_user_purchase_ebook')->insert(['ebook_id' => $resultsdata[0]->ebook_id,'user_id' => $resultsdata[0]->user_id,'coupon_id' =>"0",'payment_id' => $resultsdata[0]->payment_id, 'createddate' => $currentDate ]);
$msg = "jignesh";
}else if($transaction->isFailed()){
$aUpdate = DB::table('tbl_payment')->where('order_id',$order_id)->update(['payment_status'=>"fail"]);
$msg = "kanu";
}
$bookdata = DB::select('select * from mb_EBuuk120610 where ebook_id = "'.$resultsdata[0]->ebook_id.'"');
Session::flash('messageDATA', 'Successfully deleted the nerd!');
return redirect()->to('/book/'.$resultsdata[0]->ebook_id.'/'.str_slug($bookdata[0]->ebook_title_eng,'-'))->with('message',"Thish is my message");
// dd($transaction);
}
当我尝试在视图或控制器中获取消息变量但没有给我任何输出时,因此可以提供任何帮助。 我已经尝试了所有可能的方法,但是没有给我输出。