Algún tutorial para rellenar tablas relaciónes polimorficas mediante formularios?

|
Yannickshadownet 2020-04-23 13:09:06
Need help
Yannickshadownet 2020-04-23 13:09:19
laravel_discuss-34411.jpg

Yannickshadownet 2020-04-23 13:09:29
How to fix this error ?
skys215 2020-04-23 13:52:20
ssj7_gs 2020-04-23 13:06:39
excuse me good afternoon sir I want to ask how to manually update the polymorphic many to many, how do I create it, I have succeeded. Please enlighten me, thank you

Attach, detach, sync

emiaH1 2020-04-23 13:54:57
Algún tutorial para rellenar tablas relaciónes polimorficas mediante formularios??
emiaH1 2020-04-23 13:55:14
forms for related tables ? Any tutorials?
2020-04-23 14:21:24
hey friend how can i convert this query to elequent
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
ssj7_gs 2020-04-23 14:26:33
skys215 2020-04-23 13:52:20
Attach, detach, sync

How to make attach, detach, sync please

Gabby_Json 2020-04-23 14:32:02
Yannickshadownet 2020-04-23 13:09:19

Your code

Yannickshadownet 2020-04-23 15:27:56
Gabby_Json 2020-04-23 14:32:02
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’);}

}

Yannickshadownet 2020-04-23 15:27:56
Gabby_Json 2020-04-23 14:32:02
Your code

<?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”];

Yannickshadownet 2020-04-23 15:28:46
this is the code in my controller
Yannickshadownet 2020-04-23 15:32:59
laravel_discuss-34427.jpg
I get this error when i click on submit button
Yannickshadownet 2020-04-23 15:34:08
my button call payWithpaypal function in my controller
2020-04-23 17:29:40
Can someone help me when I could have gotten it wrong.
2020-04-23 17:30:05
It’s been days since I tried to run the npm command in my vscode
2020-04-23 17:30:12
But all is in vain.
2020-04-23 17:30:48
So I had to forward my query here and share some insight with anyone willing to help
2020-04-23 17:31:01
Here is the feedback I get.
2020-04-23 17:32:27
laravel_discuss-34437.jpg

Dev 2020-04-23 17:43:20
2020-04-23 17:32:27

Are you running behind the proxy?

Dev 2020-04-23 17:43:48
or VPN.
2020-04-23 17:53:41
Dev 2020-04-23 17:43:48
or VPN.

Yeah I guess it’s the VPN connection..but let me change I shall give you feedback
Thanks though.

Dev 2020-04-23 17:56:15
2020-04-23 17:53:41
Yeah I guess it’s the VPN connection..but let me change I shall give you feedback
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.

2020-04-23 18:01:54
Dev 2020-04-23 17:56:15
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.

Which command could best help me..cled the package-lock.json file and node_modules at the same time.?

Dev 2020-04-23 18:08:41
2020-04-23 18:01:54
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.

Dev 2020-04-23 18:11:24
Yannickshadownet 2020-04-23 15:27:56
<?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”];

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.

Yannickshadownet 2020-04-23 18:49:48
Dev 2020-04-23 18:11:24
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

Dev 2020-04-23 18:50:21
Yannickshadownet 2020-04-23 18:49:48
Okay sorry

That’s okay. No issues.

Dev 2020-04-23 18:50:40
Yannickshadownet 2020-04-23 13:09:19

Can you post code for this?

Dev 2020-04-23 18:50:56
or just the screenshot.
Dev 2020-04-23 18:51:08
Take screenshot of the code.
Dev 2020-04-23 18:52:17
By the way, what PHP version are you using?
2020-04-23 18:57:18
Hello give me auth laravel vue js pls
2020-04-23 18:57:25
Thank u
Dev 2020-04-23 18:58:50
2020-04-23 18:57:18
Hello give me auth laravel vue js pls

Follow this documentation.

https://laravel.com/docs/7.x/frontend

Dhana 2020-04-23 18:59:35
laravel_discuss-34458.jpg
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…
Dev 2020-04-23 18:59:56
2020-04-23 18:57:18
Hello give me auth laravel vue js pls

First, run composer require laravel/ui.

For Vue auth scaffolding, run the following command:

php artisan ui vue –auth

2020-04-23 19:00:00
Dev 2020-04-23 18:58:50
Follow this documentation.

https://laravel.com/docs/7.x/frontend

User / roles pliz

Dev 2020-04-23 19:03:09
Dhana 2020-04-23 18:59:35
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…

Why do you use Auth::logout(), Session::flush() and redirect at the same time? Auth::logout() will alone do everything for you.

Dev 2020-04-23 19:05:52
2020-04-23 19:00:00
User / roles pliz

Sorry?

Yannickshadownet 2020-04-23 19:07:08
Dev 2020-04-23 18:52:17
By the way, what PHP version are you using?

I solve it now

I change the php version in my cpanel to 7.2

Dhana 2020-04-23 19:08:03
Dev 2020-04-23 19:03:09
Why do you use Auth::logout(), Session::flush() and redirect at the same time? Auth::logout() will alone do everything for you.

Tried that one also

Dev 2020-04-23 19:12:53
Yannickshadownet 2020-04-23 19:07:08
I solve it now

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.

Dev 2020-04-23 19:14:21
Dhana 2020-04-23 19:08:03
Tried that one also

It would be better if you record a brief video of it to understand it better.

2020-04-23 19:44:36
how i can download laravel offline
2020-04-23 19:45:18
2020-04-23 19:44:36
how i can download laravel offline

pls provide link

Dev 2020-04-23 19:45:42
2020-04-23 19:45:18
pls provide link

Just download it from GitHub.

2020-04-23 19:47:09
Dev 2020-04-23 19:45:42
Just download it from GitHub.

correct github link??

Dev 2020-04-23 19:48:52
2020-04-23 19:47:09
correct github link??

https://github.com/laravel/laravel

GitHub – 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
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 …
|