[PHP open source class library] simple excel - a reading and writing tool for Excel and CSV files with elegance and performance

This extension package allows you to easily read and write simple Excel and CSV files. Use generators in the background to ensure low memory usage, even when working with large files. This is an example of how to read Excel or CSV. SimpleExcelReader::create($pathToFile)->getRows() ->each(function(array $rowProperties) { // pr ...

Posted on Sat, 28 Mar 2020 05:03:36 -0700 by Thresher

Verify user when Laravel admin calls api, Laravel guard uses correct posture

What is a Guard? Guard is an important part of the permission authentication component of the Laravel framework: 1. Your application may be divided into front-end users and back-end management users. 2. Your application may be both a traditional php rendered html application and an api interface service for other applications such as Android mo ...

Posted on Thu, 19 Mar 2020 19:05:56 -0700 by ijmccoy

Laravel event asynchronous example

It was sorted out yesterday Event mechanism of Laravel Today, I want to verify its asynchronous operation. 1, preparation 1.1 create Event and Listener respectively, \App\Events\Test::class => [ \App\Listeners\TestA::class ], app\Events\Test: <?php namespace App\Events; use Illuminate\Broadcasting\Channel; ...

Posted on Mon, 16 Mar 2020 22:10:07 -0700 by ud2008

Event mechanism in Laravel

Laravel Events provide a simple observer mode implementation that allows you to subscribe to and monitor events in your application. Event classes are usually stored in the app/Events directory, and listeners are stored in the app/Listeners. Events provide an effective solution for decoupling application modules because a single event can hav ...

Posted on Mon, 16 Mar 2020 10:22:55 -0700 by dastaten

PHP+swoole to realize the function of chatting and mass sending

This article mainly introduces PHP+swoole to realize the function of chatting and mass sending. I hope it can be helpful for you if you are interested in it. php code: $serv = new swoole_websocket_server("127.0.0.1",3999); //Basic settings of service $serv->set(array( 'worker_num' => 2, 'reactor_num'=>8, 'task_worker_num'=>1, ...

Posted on Mon, 06 Jan 2020 03:35:49 -0800 by kaitan

Laravel 5.5 source notes (3. facade)

Last time I said provider, this time I said facade The first is the source of startup. From the $bootstrappers array in the kernel class of laravel, we can see some of its system boot methods. The registerfacies is used to register the facade class. protected $bootstrappers = [ \Illuminate\Foundation\Bootstrap\LoadEnvironmentVariab ...

Posted on Tue, 10 Dec 2019 10:40:46 -0800 by jonoc33

Implement a simple di container

I have seen many frameworks before, such as laravel, thinkphp, yii, etc. Basically, containers are used. For me, although I understand how laravel is written, if I don't try it, I still don't think it will be. The following code is a simple container I implemented. It's not very good in many places, but it should be enough. <?php class Cont ...

Posted on Wed, 04 Dec 2019 14:52:31 -0800 by RaheimSG

Laravel polymorphism association (morphTo,morphMany)

Laravel polymorphism association (morphTo,morphMany)In the process of website development, we often encounter comment products, comment articles, comment stores, etc. when dealing with such needs, we often create a new comment table, and then distinguish the object development process of comments through a type field as follows: New table opera ...

Posted on Mon, 02 Dec 2019 08:59:47 -0800 by bladx

Cookie serialization problems encountered after Laravel 5.5 upgrade to 5.5.42

Recently, the small version number of Laravel (v5.5.39 = > v5.5.45) in the project has been upgraded for the manual disabled. If it is not upgraded, it will have problems as soon as it is upgraded! Error prompt on Sentry platform: openssl_encrypt() expectations parameter 1 to be string, array given. The specific error record is as follows: E ...

Posted on Sun, 01 Dec 2019 10:18:59 -0800 by Major Tom

Laravel admin usage record - quickly build CURD

Introducer After the installation, simply change the configuration and page effect. Next, build CURD quickly. Use the faker & users table used in the previous test. Controller and routing Specify the model generation controller PHP artican admin: make database \ \ fakerusercontroller -- model = app \ \ models \ \ fakeruser. After execution ...

Posted on Sat, 30 Nov 2019 20:57:21 -0800 by Zippyaus