Record the queue exception caused by Laravel Observer
1. Business logic
After a new model is Created, use the Observer model event Created to push the asynchronous short message sending queue
App\Http\Controllers\UsersController
public function store(User $user)
{
\DB::beginTransaction();
try{
$input = request()->validated();
$user->fill($inp ...
Added by Tensing on Fri, 29 Oct 2021 10:37:04 +0300
oauth2 mechanism of laravel passport -- installation and configuration
home pagespecial columnphpArticle details0oauth2 mechanism of laravel passport (I) -- installation and configurationI don't think so Published 2 minutes ago1, Oauth21. Definition:OAuth 2.0 is an authorization mechanism, which is mainly used to issue token s.2. Members:ClientService (authentication server)3. Process:application(client) requests ...
Added by Imtehbegginer on Fri, 29 Oct 2021 08:44:40 +0300
Laravel service container
DI
DI is often referred to as dependency injection, so what is dependency injection?
For example, a computer (not a laptop) needs a keyboard and mouse for us to operate. This' need 'in other words, it depends on the keyboard and mouse.
Accordingly, a class needs another class to perform a job, which is called dependency.
Look at a piece of ...
Added by dewed on Sun, 26 Sep 2021 06:11:32 +0300
LaravelAlipay Payment
1. Payment function
1.1 Alipay Payment Installation Configuration
Then Alipay Scavenger logs in. Because the personal number is unable to apply for the payment key, we use its sandbox environment. We can recharge any amount on our side in a sandbox environment.
Similarly, third-party packages can be used for development in laravel t ...
Added by tcorbeil on Thu, 16 Sep 2021 04:26:18 +0300
Picture deletion for laravel-admin
There is a deep doubt about laravel-admin's picture upload mechanism. Deleting avatar pictures on the user information page will cause an error. It was 1.4 at that time, and later updated 1.5 found that the delete button disappeared directly. If you use image normally in the form during the process of use, the slight ...
Added by sansoo on Sat, 18 Jul 2020 17:36:44 +0300
Picture deletion for laravel-admin
There is a deep doubt about laravel-admin's picture upload mechanism. Deleting avatar pictures on the user information page will cause an error. It was 1.4 at that time, and later updated 1.5 found that the delete button disappeared directly. If you use image normally in the form during the process of use, the slight ...
Added by Joan Collins on Sat, 18 Jul 2020 17:37:13 +0300
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