Created
October 16, 2021 17:55
-
-
Save AhmedHelalAhmed/204913aa89d2217fe0fed281fbd4a877 to your computer and use it in GitHub Desktop.
test docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use App\Jobs\LogToFile; | |
use Illuminate\Support\Facades\Redis; | |
use Illuminate\Support\Facades\Route; | |
/* | |
|-------------------------------------------------------------------------- | |
| Web Routes | |
|-------------------------------------------------------------------------- | |
| | |
| Here is where you can register web routes for your application. These | |
| routes are loaded by the RouteServiceProvider within a group which | |
| contains the "web" middleware group. Now create something great! | |
| | |
*/ | |
Route::get('/', function () { | |
return view('welcome'); | |
}); | |
// redis | |
//.. | |
Route::get('/test-redis-cache', function () { | |
Redis::set('name', 'Ahmed Helal'); | |
dd(Redis::get('name')); | |
}); | |
// database | |
//.. | |
Route::get('/test-database', function () { | |
if(!\App\Models\User::count()){ | |
\App\Models\User::factory()->create(); | |
} | |
dd(\App\Models\User::first()->toArray()); | |
}); | |
// redis as queue driver | |
//.. | |
Route::get('/test-redis-queue', function () { | |
dispatch(new LogToFile); | |
$queueName = 'default'; | |
dd( | |
'Event dispatched', | |
Redis::keys('*'), | |
Redis::llen('queues:' . $queueName) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment