Some problem records of laravel+nginx error 500 after configuration have been solved

1, Check the ngxin configuration. Here is my nginx configuration Here paste the source code for your reference: user www www; worker_processes 4; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user ...

Added by a6000000 on Wed, 29 Apr 2020 17:13:02 +0300

Laravel Contracts Conceptual Analysis and Code Samples

Introduction to Contracts Laravel's Contract Contracts are a set of interfaces and a specification for code implementation.The Laravel Framework Core Service provides many Contracts, such as IlluminateContracts\Logging\LoggingLogging, which defines the method required to log. The framework itself has corresponding implementations for Contracts, ...

Added by andychurchill on Sat, 11 Apr 2020 04:52:21 +0300

Vue obtains router dynamically from server

Preparatory work Provide interface Rewrite route Provide interface laravel provides the interface. It's in minutes, isn't it api.php Route::group(['prefix'=>'admin','middleware'=>'format'], function (){ Route::get('routes','Manager\RouterController@getRouter'); }); Then write a getRouter method like RouterController pu ...

Added by Ayon on Tue, 31 Mar 2020 19:29:41 +0300

Laravel Model Association, association query, preload use instance

Data tables are usually associated with each other, and it is usually easier to use multi table associated query, which is more convenient and simple for more complex model associated query using laravel, Chinese document , take two tables of provinces and cities as an example Preliminary preparation: First, create a PlaceController controller ...

Added by zab329 on Mon, 23 Mar 2020 11:54:51 +0200

yield and Generator of php and its application

yield and Generator of php and its application Reference resources When viewing the laravel source code, you can see the following code vendor\laravel\framework\src\Illuminate\Container\Container.php public function tagged($tag) { if (! isset($this->tags[$tag])) { return []; ...

Added by nomanoma on Sun, 19 Jan 2020 10:04:29 +0200

Laravel Composer automatic loading mechanism

outline PHP autoloading function 1.1 Origin of PHP autoloading function 1.2 PHP autoload function u autoload() Problems with 1.3 u autoload() Function 1.4 SPL Autoload PSR Specification The automatic loading process of comoposer composer source analysis 4.1 Startup 4.2 Composer autoload file 1, PHP autoloading function 1.1 Origin o ...

Added by Dolemite50 on Sat, 14 Dec 2019 10:54:58 +0200

Laravel user authorization Gate and Policy

Main points: Laravel has two main ways to implement user authorization: gates and policies. Gates accepts an instance of the currently logged in user as the first parameter. And receive optional parameters, such as the relevant Eloquent model. Using command to generate policy PHP artican make: policy postpolicy -- model = post The ...

Added by mithril on Sat, 07 Dec 2019 16:04:08 +0200

[PHP advanced features] ArrayAccess (array access) interface

php provides six commonly used predefined interfaces to implement certain specific capabilities. The most commonly used one is ArrayAccess, which is used in popular frameworks like Laravel. What is ArrayAccess As stated in the official documentation, it "provides an interface to the ability to access objects like arrays.". It provides ...

Added by cheechm on Fri, 06 Dec 2019 13:55:26 +0200

Self developed composer package of lumen

Take my zero / lumen elastic search package as an example Note that this plug-in uses the lumen framework 1. Installation dependency composer require zzq/lumen-elasticsearch 2. Create the elasticsearch.php configuration file with the following contents: <?php return [ /** * You can specify one of several different connections whe ...

Added by ThaSpY on Wed, 13 Nov 2019 16:24:15 +0200

PHP Framework websocket Active Message Push

Laravel combines swoole to implement a function that actively triggers message pushing, which allows you to send custom messages to all members of the template message, instead of sending messages through the client, and listens to the messages sent in the message on the service side for business logic. Active Message Push ImplementationNormall ...

Added by neptun on Tue, 12 Nov 2019 05:17:24 +0200