samedi 31 mars 2018

how to post the data of the client entered during registration into WHMCS using laravel

I have entered the controller and route code below and suggest me a solution to post the datas into WHMCS.

<?php

namespace App\Http\Controllers;

use App\Http\Controllers\ProductController;


use Illuminate\Http\Request;

use DarthSoup\Whmcs\Facades\Whmcs;
use Darthsoup\Whmcs\WhmcsServiceProvider;

use WHMCS\Database\Capsule;

class ProductController extends Controller
{
public function insertform(){
    return view('clientlayout.main.signup');
    } 


 public function insert(Request  $request)
 {
  $request=array();
    $request["firstname"] = $_POST['firstname'];
    $request["lastname"]=  $_POST['lastname'];
    $request["companyname"] =  $_POST['companyname'];
    $request["email"] =  $_POST['email'];
    $request["address1"] =  $_POST['address1'];
    $request["address2"] =  $_POST['address2'];
    $request["city"] =  $_POST['city'];
    $request["state"] =  $_POST['state'];
    $request["postcode"] =  $_POST['postcode'];
    $request["country "]=  $_POST['country'];
    $request["phonenumber "]=  $_POST['phonenumber'];
    $request["password"] =  $_POST['password'];

        $whmcs = Whmcs::create($request); 
        return redirect()->route('whmcs.detail', ["firstname" => $whmcs- 
        >firstname]);      

        print_r($request);

           echo '<a href = "/insert">Click Here</a> to go back.';

     }
     }

The logic in blade file is given below:

 <form class="container" action="" id="needs- 
  validation" method="post" novalidate>
    <input type = "hidden" name = "_token" value = "<?php echo csrf_token(); 
  ?>">

My route code is given below:

Route::get('insert', 'ProductController@insertform');
Route::post('insert', 'ProductController@insert')->name('product.insert');

Give me an idea in storing the data entered by the client during registration into WHMCS, as I'm having an issue in Storing it in WHMCS.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2GnJMKZ
via IFTTT

Aucun commentaire:

Enregistrer un commentaire