Facade in TP Framework, you know

What is a Facade, currently considered a class that facilitates the static invocation of the corresponding method to an existing class (which does not define a static method).The implementation of the specific Facade is as follows:First look at the core files:\thinkphp\base.php`//Register static proxy for core classFacade::bind([ facade\App::cl ...

Posted on Wed, 20 Nov 2019 02:18:30 -0500 by Masterchief07

The scheme of self increasing in Laravel

In the work, a series of data are often added automatically, and a scenario is envisaged.A total of 10 coupons will be issued (the following operations are in time series)1) user 1 requests to receive 1 coupon;2) process 1 queries the remaining 10 coupons in the database, and the code updates the number of coupons. At this time, the number of ...

Posted on Mon, 11 Nov 2019 14:58:14 -0500 by sholtzrevtek

What's a Facade? I hope it's useful for PHPer

What is the Facade? At present, it is a class that is used to facilitate the static method call of the original class (undefined static method).The specific implementation of Facade is as follows:First look at the core document:\thinkphp\base.php`//Register static proxy of core classFacade::bind([ facade\App::class => App::class, facade ...

Posted on Fri, 08 Nov 2019 04:22:41 -0500 by unbreakable9

Laravel queue technique: Fail, Retry, or Delay

The article was forwarded from the professional Laravel developer community with the original link: https://learnku.com/laravel/t... When creating queue jobs, listeners, or subscribers to push into a queue, you may begin to think that once dispatched, it is entirely up to you for the queue worker to decide how to handle your logic. Hmm...It's ...

Posted on Thu, 07 Nov 2019 21:25:26 -0500 by stevel

PHP analyzes the dependency injection function of Laravel framework from another perspective

Fundamentally speaking, dependency injection is not to let an object create a dependency, nor let a factory object create an object, but to turn the required dependency into an external object, making it a "someone's problem" You inject class dependencies into "some people's problems.". In Laravel, this "somebody" ...

Posted on Tue, 05 Nov 2019 07:50:58 -0500 by micki

Single sign on - API certification system Passport

install composer require laravel/passport=~4.0 notes: 1) ensure that unzip, zip and other commands are installed on the system. 2) there is Authentication required (packagist.phpcomposer.com) problem in composer installation. Modify the source in composer.json, repositories.packagist.url = https://packagist.laravel-china.org. Register service p ...

Posted on Fri, 01 Nov 2019 06:24:28 -0400 by Octave91

The usage of PHP array Ou reduce

At first, I didn't understand the array UU reduce method very well. Then I changed my implementation and found that I understood a lot better. For example, the custom array UU reduce function implemented below is actually the same as the result of the implementation of the array UU reduce method. $arr = ...

Posted on Fri, 01 Nov 2019 02:20:07 -0400 by smc

The problem of three-level linkage in the urban area of laravel admin Province

Official website: https://github.com/laravel-admin-extensions/china-distpicker //If you want to use the name of the province or city, remember to download the file China distpicker / china_area.sql and import it into your own database.Screenshots:install composer require laravel-admin-ext/china- ...

Posted on Thu, 31 Oct 2019 02:52:57 -0400 by jmaker

Laravel documentation tool

laravel-doc Laravel doc is a project used to generate documents, write documents through markdown, and provide web access to documents. Installation requirements PHP >= 7.0.0 Laravel >= 5 install composer require foryoufeng/laravel-doc       If you are running Laravel 5.5 or below, you need to add it in the service pro ...

Posted on Wed, 30 Oct 2019 03:57:00 -0400 by abhi_madhani

Laravel integrated Swoole tutorial

1. Preparation Install Laravel laravel new laravel-swoole       I use valet for development, and can use laravel-swoole.test       Visit 2. Introduction of swoole For specific swoole installation, please go to the official website to download, compile and install, which is not described here. 1. Create a server fol ...

Posted on Sat, 26 Oct 2019 11:16:41 -0400 by lajollabob