helori/laravel-saas 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

helori/laravel-saas

Composer 安装命令:

composer require helori/laravel-saas

包简介

Software as a Service scaffholding for Laravel based on Vue 3, Tailwindcss and Stripe. Inspired by Laravel Jetstream and Spark.

README 文档

README

Software as a Service scaffholding for Laravel based on Vue 3, Tailwindcss and Stripe. Inspired by Laravel Jetstream and Spark.

On a fresh Laravel 8 application, install the package running the following command. It will install all dependencies such as laravel/cashier, laravel/fortify, laravel/sanctum, ...

composer require helori/laravel-saas

Publish the configuration files, migrations, routes, views and assets :

php artisan vendor:publish --provider="Laravel\Fortify\FortifyServiceProvider"
php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
php artisan vendor:publish --provider="Helori\LaravelSaas\SaasServiceProvider" --force

Run the migrations. Laravel default migrations and the package migrations will be run :

php artisan migrate

Add Sanctum's middleware to your api middleware group within your application's app/Http/Kernel.php file:

'api' => [
    \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
    ...
],

Modify your .env file with the following configuration :

SESSION_DRIVER=database
SESSION_SECURE_COOKIE=true
SAME_SITE_COOKIES=none

SESSION_DOMAIN=".my-domain.test"
SANCTUM_STATEFUL_DOMAINS="my-domain.test"

STRIPE_KEY=stripe-key
STRIPE_SECRET=stripe-secret

CASHIER_CURRENCY=eur
CASHIER_CURRENCY_LOCALE=fr_FR
CASHIER_LOGGER=stack

Make sure your config/session.php has the following configuration :

'same_site' => env('SAME_SITE_COOKIES', 'lax'),

Make sure your config/cors.php has the following configuration :

'supports_credentials' => true,

Update your app\Providers\RouteServiceProvider.php as follows :

public const HOME = '/app';

Install front-end dependencies :

npm i @tailwindcss/forms @tailwindcss/typography axios tailwindcss vue@next vue-router@4 @heroicons/vue numeral moment --save-dev

Compile your assets :

npm run watch

You can use the package seeders to seed your application with test data. To do so, edit your database/seeders/DatabaseSeeder.php like so :

<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;

use Helori\LaravelSaas\Seeders\RootSeeder;
use Helori\LaravelSaas\Seeders\UserSeeder;
use Helori\LaravelSaas\Seeders\SubscriptionSeeder;


class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        $this->call([
            RootSeeder::class,
            UserSeeder::class,
            SubscriptionSeeder::class,
        ]);
    }
}

You can now refresh your database using :

php artisan migrate:fresh --seed

统计信息

  • 总下载量: 1.36k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 12
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 12
  • Watchers: 2
  • Forks: 1
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固