How to fix this error ?
Algún tutorial para rellenar tablas relaciónes polimorficas mediante formularios?
forms for related tables ?
Are you running behind the proxy?
Can you post code for this?
By the way, what PHP version are you using?
correct github link?


Attach, detach, sync
SELECT profil.category_id,profil.image,profil.about_me,categories.cat_name,users.name,users.id FROM profil
INNER JOIN categories
ON profil.category_id = categories.id
JOIN users ON users.id = profil.user_id WHERE profil.category_id = $id ORDER BY users.name ASC
How to make attach, detach, sync please
Your code
$payment_id = Session::get(‘paypal_payment_id’);
//dd($payment_id);
/ clear the session payment ID /
Session::forget(‘paypal_payment_id’);
if (empty($s) || empty($t)) {
Session::put(‘error’, ‘Payment failed’);
return Redirect::route(‘PayementWithPaypal’);
}
$payment = Payment::get($payment_id, $this->_api_context);
$execution = new PaymentExecution();
$execution->setPayerId($u);/Execute the payment /
$result = $payment->execute($execution, $this->_api_context);
if ($result->getState() == ‘approved’) {
Session::put(‘success’, ‘Payment success’);
return Redirect::route(‘PayementWithPaypal’);
}
Session::put(‘error’, ‘Payment failed’);
return Redirect::route(‘PayementWithPaypal’);}
}
<?php
namespace AppHttpControllers;
use IlluminateHttpRequest;
use Validator;
use URL;
use Session;
use Redirect;
/* use Input; */
use AppHttpRequests;
/* use IlluminateSupportFacadesInput; */
/ All Paypal Details class /
use PayPalRestApiContext;
use PayPalAuthOAuthTokenCredential;
use PayPalApiAmount;
use PayPalApiDetails;
use PayPalApiItem;
use PayPalApiItemList;
use PayPalApiPayer;
use PayPalApiPayment;
use PayPalApiRedirectUrls;
use PayPalApiExecutePayment;
use PayPalApiPaymentExecution;
use PayPalApiTransaction;
use PayPalExceptionPayPalConnectionException;
class PaymentController extends Controller
{
private $_api_context;
public function __construct()
{
/* parent::__construct(); */
/ PayPal api context /
$paypal_conf = Config::get(‘paypal’);
$this->_api_context = new ApiContext(new OAuthTokenCredential(
$paypal_conf[‘client_id’],
$paypal_conf[‘secret’])
);
$this->_api_context->setConfig($paypal_conf[‘settings’]);
}
public function payWithpaypal(Request $request)
{
// Amount received as request is validated here.
$request->validate([‘amount’ => ‘required|numeric’]);
//$amount = $request->amount;
$payer = new Payer();
$payer->setPaymentMethod(‘paypal’);
$item_1 = new Item();
$item_1->setName(‘Don à ELDORA ‘) / item name /
->setCurrency(‘USD’)
->setQuantity(1)
->setPrice($request->get(‘amount’)); / unit price /
$item_list = new ItemList();
$item_list->setItems(array($item_1));
$amount = new Amount();
$amount->setCurrency(‘USD’)
->setTotal($request->get(‘amount’));
$transaction = new Transaction();
$transaction->setAmount($amount)
->setItemList($item_list)
->setDescription(‘Don à ELDORA’);
$redirect_urls = new RedirectUrls();
$redirect_urls->setReturnUrl(URL::route(‘status’)) / Specify return URL /
->setCancelUrl(URL::route(‘status’));
$payment = new Payment();
$payment->setIntent(‘Sale’)
->setPayer($payer)
->setRedirectUrls($redirect_urls)
->setTransactions(array($transaction));
/ dd($payment->create($this->_api_context));exit; /
try {
$payment->create($this->_api_context);
}
catch (PayPalExceptionPPConnectionException $ex)
{
if (Config::get(‘app.debug’)) {
Session::put(‘error’, ‘Connection timeout’);
return Redirect::route(‘paywithpaypal’);
}
else
{Session::put(‘error’, ‘Some error occur, sorry for inconvenient’);
return Redirect::route(‘paywithpaypal’);
}
}
foreach ($payment->getLinks() as $link)
{
if ($link->getRel() == ‘approval_url’)
{
$redirect_url = $link->getHref();
break;
}
}
/ add payment ID to session /
Session::put(‘paypal_payment_id’, $payment->getId());
if (isset($redirect_url))
{/ redirect to paypal /
return Redirect::away($redirect_url);
}Session::put(‘error’, ‘Unknown error occurred’);
return Redirect::route(‘paywithpaypal’);
}
public function getPaymentStatus(Request $request)
{
/ Get the payment ID before session clear /
$s=$request[“PayerID”];
$t=$request[“token”];
$u=$request[“PayerID”];

I get this error when i click on submit button

Are you running behind the proxy?
Yeah I guess it’s the VPN connection..but let me change I shall give you feedback
Thanks though.
Thanks though.
Okay. Once you change to normal connection, clear everything and re-run the command.
Clear everything in the sense, remove package-lock.json file and node_modules folder. Then clear the npm cache with npm cache clear –force and finally run npm install and there you go.
Clear everything in the sense, remove package-lock.json file and node_modules folder. Then clear the npm cache with npm cache clear –force and finally run npm install and there you go.
Which command could best help me..cled the package-lock.json file and node_modules at the same time.?
Just rm command is enough. If you are deleting directories, use -Rf flags like rm -Rf directory which will remove directories recursively with force.
namespace AppHttpControllers;
use IlluminateHttpRequest;
use Validator;
use URL;
use Session;
use Redirect;
/* use Input; */
use AppHttpRequests;
/* use IlluminateSupportFacadesInput; */
/ All Paypal Details class /
use PayPalRestApiContext;
use PayPalAuthOAuthTokenCredential;
use PayPalApiAmount;
use PayPalApiDetails;
use PayPalApiItem;
use PayPalApiItemList;
use PayPalApiPayer;
use PayPalApiPayment;
use PayPalApiRedirectUrls;
use PayPalApiExecutePayment;
use PayPalApiPaymentExecution;
use PayPalApiTransaction;
use PayPalExceptionPayPalConnectionException;
class PaymentController extends Controller
{
private $_api_context;
public function __construct()
{
/* parent::__construct(); */
/ PayPal api context /
$paypal_conf = Config::get(‘paypal’);
$this->_api_context = new ApiContext(new OAuthTokenCredential(
$paypal_conf[‘client_id’],
$paypal_conf[‘secret’])
);
$this->_api_context->setConfig($paypal_conf[‘settings’]);
}
public function payWithpaypal(Request $request)
{
// Amount received as request is validated here.
$request->validate([‘amount’ => ‘required|numeric’]);
//$amount = $request->amount;
$payer = new Payer();
$payer->setPaymentMethod(‘paypal’);
$item_1 = new Item();
$item_1->setName(‘Don à ELDORA ‘) / item name /
->setCurrency(‘USD’)
->setQuantity(1)
->setPrice($request->get(‘amount’)); / unit price /
$item_list = new ItemList();
$item_list->setItems(array($item_1));
$amount = new Amount();
$amount->setCurrency(‘USD’)
->setTotal($request->get(‘amount’));
$transaction = new Transaction();
$transaction->setAmount($amount)
->setItemList($item_list)
->setDescription(‘Don à ELDORA’);
$redirect_urls = new RedirectUrls();
$redirect_urls->setReturnUrl(URL::route(‘status’)) / Specify return URL /
->setCancelUrl(URL::route(‘status’));
$payment = new Payment();
$payment->setIntent(‘Sale’)
->setPayer($payer)
->setRedirectUrls($redirect_urls)
->setTransactions(array($transaction));
/ dd($payment->create($this->_api_context));exit; /
try {
$payment->create($this->_api_context);
}
catch (PayPalExceptionPPConnectionException $ex)
{
if (Config::get(‘app.debug’)) {
Session::put(‘error’, ‘Connection timeout’);
return Redirect::route(‘paywithpaypal’);
}
else
{Session::put(‘error’, ‘Some error occur, sorry for inconvenient’);
return Redirect::route(‘paywithpaypal’);
}
}
foreach ($payment->getLinks() as $link)
{
if ($link->getRel() == ‘approval_url’)
{
$redirect_url = $link->getHref();
break;
}
}
/ add payment ID to session /
Session::put(‘paypal_payment_id’, $payment->getId());
if (isset($redirect_url))
{/ redirect to paypal /
return Redirect::away($redirect_url);
}Session::put(‘error’, ‘Unknown error occurred’);
return Redirect::route(‘paywithpaypal’);
}
public function getPaymentStatus(Request $request)
{
/ Get the payment ID before session clear /
$s=$request[“PayerID”];
$t=$request[“token”];
$u=$request[“PayerID”];
Guys. Don’t post long code here. If your code is too long, post your code in content hosting websites like pastebin or even use Github Gist to make a secret Gist and share the URL. Posting a long code here would make it hard to read. So, better post it online and share the URL. You can also create a private URL so that only the people who have the URL can access the code.
Okay sorry
That’s okay. No issues.
Can you post code for this?
Follow this documentation.
https://laravel.com/docs/7.x/frontend

Hi everyone…can some help me..created login system in laravel..once called logout function session is destroyed…but when I click browser back 1st click it stayed in login page but in second click I can view dashboard page…
First, run composer require laravel/ui.
For Vue auth scaffolding, run the following command:
php artisan ui vue –auth
https://laravel.com/docs/7.x/frontend
User / roles pliz
Why do you use Auth::logout(), Session::flush() and redirect at the same time? Auth::logout() will alone do everything for you.
Sorry?
I solve it now
I change the php version in my cpanel to 7.2
Tried that one also
I change the php version in my cpanel to 7.2
Cool. That’s why I had to ask you the PHP version. The issue is with PHP version as that curl option is making issue in older versions.
It would be better if you record a brief video of it to understand it better.
pls provide link
Just download it from GitHub.
correct github link??
https://github.com/laravel/laravel
Laravel is a web application framework with expressive, elegant syntax. We’ve already laid the foundation for your next big idea — freeing you to create without sweating the small things. – GitHub …