PHP CS fixer, which automatically modifies the code style
start
Recently watching The way of PHP , see Code style guide PHP CS fixer in chapter.
PHP CS fixer can automatically help you fix the code style, not just formatting.
If you only need to format the code automatically when saving, PhpStorm can open this:
Many of the items sent by others have not been formatted before. At least the automatic f ...
Posted by user___ on Thu, 25 Nov 2021 19:26:46 -0800
laravel implementation order list
First, you need to create an order table
Create the database migration file when creating the model
php artisan make:model Order -m
Perfect database fields
public function up()
{
Schema::create('orders', function (Blueprint $table) {
$table->id();
$table->integer('user_id')->comment('User placin ...
Posted by sabatier on Sat, 20 Nov 2021 00:01:59 -0800
Explore Kafka from the perspective of PHP - realize simple producer function
Explore Kafka from the perspective of PHP - realize simple producer function
code first
public function actionProducer()
{
$conf = new \RdKafka\Conf();
$conf->set('metadata.broker.list', 'broker address');
/**
* kafka Delivery callback
* RdKafka\Message Object
* (
* [err] => 0 // If it is equal to 0, the delivery is ...
Posted by rweston002 on Thu, 18 Nov 2021 03:57:28 -0800
Block export of DCAT laravel excel (maatnesite \ Excel)
When exporting dcat data, you need to use row and column merging. There seems to be no introduction to row merging in the easy excel document provided by dcat. I plan to use larevel excel instead. Because I installed version 3.1 and the dcat document is 2.x, it is incompatible and needs to be modified.
When laravel admin was used to export, its ...
Posted by jameslloyd on Wed, 17 Nov 2021 16:32:10 -0800
Minimalist design pattern factory pattern
Factory Pattern
sketch
There are three types of factory modes.
1. Simple factory mode.
2. Factory method mode.
3. Abstract factory pattern.
Principles and ideas of design
Encapsulate the creation of objects in factory classes to decouple the creation and use of objects.
Product hierarchy and product family
Product hierarchy : ...
Posted by Ruiser on Thu, 11 Nov 2021 11:15:03 -0800
Volume algorithm - time complexity
[TOC]
Complexity of algorithm
Learn how to analyze the complexity of an algorithm.
Why algorithm complexity
Why do we need to introduce a concept of time complexity? Suppose we allow us to give the complexity of a code segment through running time directly on the server. This method becomes post statistics. What are the drawbacks of this app ...
Posted by Formula on Wed, 10 Nov 2021 17:57:22 -0800
Detailed explanation of Laravel Carbon extended Chinese package
Introduction
Carbon * inherits PHP's * Datetime * class and jsonseriable. Therefore, the methods not covered in * carbon * but implemented in * Datetime * and JsonSerializable * can be used.
class Carbon extends DateTime implements JsonSerializable
{
//code here
}
The Carbon class is declared under the Carbon namespace. Instead of ...
Posted by brooky on Wed, 03 Nov 2021 12:40:30 -0700
Laravel 5.8 bottom learning note 01 - control inversion and dependency injection
home pagespecial columnPHP GardenArticle details0Laravel 5.8 bottom learning note 01 - control inversion and dependency injectionIT pony Published 10 minutes agoreference material:Explanation of core concepts of laravel underlying core code analysisPHP inversion of control (IOC) and dependency injection (DI)1 - Laravel framework coreadvantageIn ...
Posted by Leviathan on Sat, 30 Oct 2021 00:58:45 -0700
laravel's mysql split table and split table associated query solution
0X00 problem appears
How does laravel of php implement horizontal sub table? Recently, there was a project in hand. The framework used the laravel7 framework of php. Due to the surge in the amount of data, 300000 rows of data were produced in one night for the details of rapid iterative development, and the main table had 12 million data. Beca ...
Posted by -entropyman on Wed, 27 Oct 2021 09:20:17 -0700
Complete SQL statements. Here is the SQL you need
Basics
Create databaseCREATE DATABASE database-nameDelete databasedrop database dbnameBackup sql server//device for creating backup data
USE master
EXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat'
//Start backup
BACKUP DATABASE pubs TO testBackCreate a new tablecreate table tabname(col1 type1 [not null] [primary key],c ...
Posted by scotte on Tue, 12 Oct 2021 19:11:16 -0700