PHP code example of marcus-campos / dealer

1. Go to this page and download the library: Download marcus-campos/dealer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

marcus-campos / dealer example snippets

bash
php artisan vendor:publish --provider="MarcusCampos\Dealer\DealerServiceProvider"
 php


namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Dealer;

class SearchController extends Controller
{
    /**
     * Index
     *
     * @param Request $request
     * @return Json
     */
    public function index(Request $request)
    {
        $query = $request->query('q');
        $result = Dealer::negotiate($query);
        return response()->api($result);
    }
}

 php
Route::get('search', "SearchController@index");