PHP code example of littlebookboy / laravel-request-queue

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

    

littlebookboy / laravel-request-queue example snippets


php artisan vendor:publish

php artisan queue:table

php artisan migrate
File > Edit Template > PHP > PHP 7.0.8 php.ini

// patch, put, delete
Route::resource('user', 'UserController', ['only' => ['store', 'update', 'destroy']]);

Route::post('callback_receiver', function (\Illuminate\Http\Request $request) {
    // 驗證 token
    ...
    
    // log the callback header
    Log::info(collect($request->header())->toJson());
});



namespace App\Http\Controllers;

use App\User;
use Illuminate\Support\Facades\Hash;

class UserController extends Controller
{
    public function update()
    {
        $user = User::find(1);
        $user->name = str_random(20);
        $user->email = str_random(20) . '@littlebookboy.dev';
        $user->password = Hash::make(str_random(8));
        $user->remember_token = Hash::make(str_random(100));
        $user->update();
    }
}

php artisan queue:failed-table

php artisan migrate
app/Jobs/RequestQueueJobs.php