laravel-swoole extension installation + php installation Swoole extension

Install swoole extension Two methods to install php extension swoole Check whether the Swoole PHP extension is enabled on the server php -i | grep swoole 1. Install using pecl command pecl install swoole 2. Manual compilation and installation Use the following command to download the swoole installation package git clone https://github.com/swoole/swoole-src.git Unzip the source […]

laravel integrates Workerman to build websocket service, front-end call, server startup

This article has relatively complete integration code and front-end test code, as well as server startup considerations. 1. Backend (laravel5.5) 1. Composer installs Workerman composer require workerman/workerman 2. Generate an execution command. After execution, a Workerman.php file will be generated in the App\Console\Command folder. php artisan make:command Workerman 3. Open the Workerman.php file and modify […]

Laravel6 uses Workerman’s Gateway-worker for long-term connection communication

1. Install gateway-worker gateway-worker which has been introduced workerman/workerman. composer require worker/gateway-worker composer require worker/gatewayclient 2. Create Workerman startup file Create an artisan command line tool to start the Socket server, and create a command line file in the app/Console/Commands directory. php artisan make:command GatewayWorkerServer

python parsing laravel cookie

– I’m learning fastapi recently, and there happens to be a crawler project that I need to develop. The company’s previous technology stack was PHP, and the old online projects were all written in laravel. I know all about laravel’s performance. It’s really hard to look at, but the development speed is really fast. Fastapi […]

Laravel Framework – Middleware

What is middleware? In the Laravel framework, middleware is a component used to handle HTTP requests. It allows you to execute some code logic before or after the request enters routing processing. Advantages and functions of middleware Handle authentication: verify that the user is logged in or check if the user has permission to access […]

Laravel automatically generates model service controller scripts through commands (model with annotations)

Yii can automatically generate models through data tables. In order for laravel to achieve the same function, the following script was written. Service controllers can also be automatically generated, and the model has automatic validation rules based on data table types. 1. Create a new app/Console/Commands/MakeMCS.php file. Copy the following code into <?php namespace App\Console\Commands; […]

laravel framework – rabbitmq message queue (using laravel-queue-rabbitmq)

Reference documentation: https://learnku.com/docs/laravel/8.x/queues/9398 https://packagist.org/packages/vladimir-yuldashev/laravel-queue-rabbitmq 1. Composer installs laravel-queue-rabbitmq. When installing, pay attention to the laravel version corresponding to the application package. composer require vladimir-yuldashev/laravel-queue-rabbitmq 2. In the config/app.php file, add in providers: VladimirYuldashev\LaravelQueueRabbitMQ\LaravelQueueRabbitMQServiceProvider::class, 3. Add the following configuration to the connections array in the app/config/queue.php configuration file ‘rabbitmq’ => [ ‘driver’ => ‘rabbitmq’, ‘dsn’ => […]

PHP – Laravel form validation (validation rules and use of $this->validate(), Validator::make(), Requests)…

1. Introduction Form verification is to prevent system security problems caused by visitors skipping client verification. Once illegal users bypass client verification without verification on the server, it is very unsafe, so Projects must perform server-side form validation. Laravel provides a variety of different validation methods to validate data passed in by the application. Commonly […]