PHP code example of goviafang / laravel-fraser

1. Go to this page and download the library: Download goviafang/laravel-fraser 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/ */

    

goviafang / laravel-fraser example snippets


// config/app.php

return [
    // ...
    
    'providers' => [
    
        // ...
        Weidner\Goutte\GoutteServiceProvider::class,
        Govia\Fraser\FraserServiceProvider::class,
    ],
    
    
    'aliase' => [
    
        // ...
        'Goutte' => Weidner\Goutte\GoutteFacade::class,
    ],
],

Route::get('fraser', function (\Govia\Fraser\Fraser $fraser) {

    $records = $fraser->setProvince('on')
        ->setGrade('elementary')
        ->getList();

    $detail = $fraser->getDetail($records->first()->link);

    dd(
        $records->first(),
        $detail
    );
});
sh
php artisan vendor:publish --tag=fraser