ralphjsmit/tall-install

Quickly scaffold a new Laravel-installation that uses the TALL-stack and install several opinionated packages.

1.4.0 2022-04-29 12:45 UTC

README

Tall-Install Banner

Easy command to install the TALL-stack & jumpstart development🚀

Run Package Tests Run Laravel Tests (Pest) (normal version) Run Laravel Tests (Pest) (DDD-version)

This package provides a simple artisan command for Laravel that can fully scaffold your application and jumpstart development.

It basically runs the installation process for all of your favourite packages, so that you can start developing right away!

⚡️ Check out the release article and subscribe to my newsletter for updates

Demo projects

👉 Check out a demo-project file's structure

👉 Check out a demo-project with an automatically generated Domain-Driven file structure

Features

  1. It runs the regular installation process for your favourite TALL-tools, so that you don't have to 🚀
  2. Install Pest instead of PHPUnit ⚙️
  3. Configure a Domain-Driven file structure (DDD)✨
  4. Install Browsersync for Valet users ⚡️

What does it install?

What can it install?

This package can also do the following things for you:

Roadmap

  • Fortify installation

The intention of this package is to do all the backend installation and not force you into anything frontend-wise.

Missing your favourite package? Feel free to submit an issue or a PR with your proposal.

Contents

  1. Installation & usage
  2. Configure DDD
  3. Install Pest
  4. Install Browsersync

Installation & usage

To get started, you need a plain Laravel installation:

laravel new name
# or
composer create-project laravel/laravel name

Install the package via composer:

composer require ralphjsmit/tall-install

Now run the tall-install command:

php artisan tall-install

# Run this to reindex potential changes in classes.
composer dump-autoload

You can use the following flags to install a particular package.

Note: you can only use this command on a plain Laravel installation. Otherwise I cannot guarantee the correct result.

Configure DDD with tall-install --ddd

You may use the --ddd or -d flag to configure DDD:

php artisan tall-install --ddd

I think this is the most powerful feature, as it rewrites your /app directory to this:

src/Support
     ├── App
         ├── Console
         ├── Exceptions
         ├── HTTP
         ├── Providers
         ├── Application.php
     ├── Models
         User.php
     ├── View/Components/Layouts
         App.php
         Admin.php
src/Domain
     // Add your own 'domains' here. Domains are where the business logic of the application is.
     ├── Invoices...
     ├── Customers...
src/App
     // Add your own 'apps' here. Apps are the exposed to the outside (like APIs, a dashboard, a separate admin panel) or are your infrastructure (jobs).
     ├── Console
     ├── Jobs
     ├── Api

For me, once I started using DDD I never wanted anything else. A good reference is the Laravel Beyond CRUD course by Brent Roose.

Install Pest with tall-install --pest

You may use the --pest or -p flag to configure Pest:

php artisan tall-install --pest

Install Browsersync with tall-install --browsersync

You may use the --browsersync or -b flag to configure Browsersync for Laravel Valet:

php artisan tall-install --browsersync

This will append the following code to your webpack.mix.js file:

/* Browsersync configuration with Laravel Valet */
mix.disableSuccessNotifications();

const domain = 'valetDomain.test';
const homedir = require('os').homedir();

mix.browserSync({
    proxy: 'https://' + domain,
    host: domain,
    open: 'external',
    https: {
        key: homedir + '/.config/valet/Certificates/' + domain + '.key',
        cert: homedir + '/.config/valet/Certificates/' + domain + '.crt'
    },
    notify: false, //Disable notifications
})

By default it takes the current folder name as the domain for Valet. You may specify a custom domain with the --url flag:

php artisan tall-install --browsersync --url=custom.test

Cleaning up

You can remove the package from your Composer dependnecies after you've run the tall-install command:

composer remove ralphjsmit/tall-install

General

🐞 If you spot a bug, please submit a detailed issue and I'll try to fix it as soon as possible.

🔐 If you discover a vulnerability, please review our security policy.

🙌 If you want to contribute, please submit a pull request. All PRs will be fully credited. If you're unsure whether I'd accept your idea, feel free to contact me!

🙋‍♂️ Ralph J. Smit