In laravel, spark is an experimental project used to build enterprise-oriented software-as-a-service applications; its main functions include member management, user role management, and billing through Stripe, that is, enterprise applications Some common features in modularization.
#The operating environment of this article: Windows 10 system, Laravel version 6, Dell G3 computer.
Spark is an experimental project, mainly used to build enterprise-oriented SaaS (Software as a Service) applications, and it was born specifically to deal with this use scenario. .
Spark’s functions include member management, user role management, billing through Stripe (it may be expanded to support Alipay), etc. In fact, it is to modularize some common functions in enterprise applications. This project is expected to evolve into a product for charging service fees for enterprises in the future, which is the same idea as the Forge and Envoyer services launched by the Laravel team.
Spark was designed with only one thing in mind, and that was how to make it easy to build payment systems in SaaS applications. If you've ever built a team management and payment system, then you know how time-consuming and painful this process can be. A lot of repetitive and tedious work is spent supporting various different systems, designing for them, creating invoice documents, and so on. Using Spark, you can focus on processing the business logic you really care about.
Getting back to business, let’s quickly take a look at how to install and use Spark.
Let’s reiterate that Spark is still in Alpha version and is not recommended for use in actual production environments. This article is just to let everyone know about its functional features.
1. Install Spark
Install directly through global composer:
composer global require "laravel/spark-installer=~1.0"
Next, create a new Laravel application or enter the root directory of an existing application to run:
spark install
You will be asked some questions on the command line during the run:
As you can see, it will prompt you to install/run all the necessary dependencies and components and runs all these commands for you. Of course, you can also run these commands manually:
php artisan migrate npm install gulp
At the end of the installation, you will be reminded to set the Stripe token and Authy key in .env. Authy is a user-protected login. Two-factor authentication (2FA) system, you can register to get a free API key.
[Related recommendations: laravel video tutorial]
The above is the detailed content of laravel spark what does it mean. For more information, please follow other related articles on the PHP Chinese website!