Giter Site home page Giter Site logo

codions-forks / laravel-saas Goto Github PK

View Code? Open in Web Editor NEW

This project forked from helori/laravel-saas

0.0 0.0 0.0 172 KB

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

License: MIT License

JavaScript 5.06% PHP 34.80% CSS 1.64% Vue 53.64% Blade 4.86%

laravel-saas's Introduction

laravel-saas

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

laravel-saas's People

Contributors

helori avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.