Giter Site home page Giter Site logo

lambo's Introduction

Lambo logo

Run tests

Super-powered laravel new for Laravel and Valet

Lambo is a command-line tool that replaces the Laravel installer and wraps up the most common tasks you might take when creating a Laravel app: opening it in your editor and your browser, initialize a git repository, tweak your .env and .env.example, and more.

Requirements

Installation

composer global require tightenco/lambo:^3.0

Upgrading

composer global update tightenco/lambo

Usage

Make sure ~/.composer/vendor/bin is in your terminal's path.

cd ~/Sites
lambo new myNextProject

What exactly does it do?

  • laravel new $PROJECTNAME
  • Initialize a git repo, add all the files, and, after some changes below, make a commit with the text "Initial commit."
  • Replace the .env (and .env.example) database credentials with the default macOS MySQL credentials: database of $PROJECTNAME, user root, and empty password
  • Replace the .env (and .env.example) APP_URL with $PROJECTNAME.$YOURVALETTLD
  • Generate an app key
  • Open the project in your favorite editor
  • Open $PROJECTNAME.$YOURVALETTLD in your browser

Note: If your $PROJECTNAME has dashes (-) in it, they will be replaced with underscores (_) in the database name.

There are also a few optional behaviors based on the parameters you pass (or define in your config file), including creating a database, migrating, installing Jetstream, running Valet Link and/or Secure, and running a custom bash script of your definition after the fact.

Customizing Lambo

While the default actions Lambo provides are great, most users will want to customize at least a few of the steps. Thankfully, Lambo is built to be customized!

There are three ways to customize your usage of Lambo: command-line arguments, a config file, and an "after" file.

Most users will want to set their preferred configuration options once and then never think about it again. That's best solved by creating a config file.

But if you find yourself needing to change the way you interact with Lambo on a project-by-project basis, you may also want to use the command-line parameters to customize Lambo when you're using it.

Creating a config file

You can create a config file at ~/.lambo/config rather than pass the same arguments each time you create a new project.

The following command creates the file, if it doesn't exist, and edits it:

lambo edit-config

The config file contains the configuration parameters you can customize, and will be read on every usage of Lambo.

Creating an "after" file

You can also create an after file at ~/.lambo/after to run additional commands after you create a new project.

The following command creates the file, if it doesn't exist, and edits it:

lambo edit-after

The after file is interpreted as a bash script, so you can include any commands here, such as installing additional composer dependencies...

# Install additional composer dependencies as you would from the command line.
echo "Installing Composer Dependencies"
composer require tightenco/mailthief tightenco/quicksand

...or copying additional files to your new project.

# To copy standard files to new lambo project place them in ~/.lambo/includes directory.
echo "Copying Include Files"
cp -R ~/.lambo/includes/ $PROJECTPATH

You also have access to variables from your config file such as $PROJECTPATH and $CODEEDITOR.

Using command-line parameters

Any command-line parameters passed in will override Lambo's defaults and your config settings. See a full list of the parameters you can pass in.

Lambo Commands

  • help or help-screen show the help screen

  • edit-config edits your config file (and creates one if it doesn't exist)

    lambo edit-config
  • edit-after edits your "after" file (and creates one if it doesn't exist)

    lambo edit-after

Configurable parameters

You can optionally pass one or more of these parameters every time you use Lambo. If you find yourself wanting to configure any of these settings every time you run Lambo, that's a perfect use for the config files.

  • -e or --editor to define your editor command. Whatever is passed here will be run as $EDITOR . after creating the project.

    # runs "subl ." in the project directory after creating the project
    lambo new superApplication --editor=subl
  • -p or --path to specify where to install the application.

    lambo new superApplication --path=~/Sites
  • -m or --message to set the first Git commit message.

    lambo new superApplication --message="This lambo runs fast!"
  • -f or --force to force install even if the directory already exists

    # Creates a new Laravel application after deleting ~/Sites/superApplication  
    lambo new superApplication --force
  • -d or --dev to choose the develop branch instead of master, getting the beta install.

    lambo new superApplication --dev
  • -b or --browser to define which browser you want to open the project in.

    lambo new superApplication --browser="/Applications/Google Chrome Canary.app"
  • -l or --link to create a Valet link to the project directory.

    lambo new superApplication --link
  • -s or --secure to secure the Valet site using https.

    lambo new superApplication --secure
  • --create-db to create a new MySQL database which has the same name as your project. This requires mysql command to be available on your system.

    lambo new superApplication --create-db
  • --migrate-db to migrate your database.

    lambo new superApplication --migrate-db
  • --dbuser to specify the database username.

    lambo new superApplication --dbuser=USER
  • --dbpassword specify the database password.

    lambo new superApplication --dbpassword=SECRET
  • --dbhost specify the database host.

    lambo new superApplication --dbhost=127.0.0.1
  • --breeze=STACK to use the Laravel Breeze starter kit. STACK may be either blade, vue or react.

    lambo new superApplication --breeze=blade
    lambo new superApplication --breeze=vue
    lambo new superApplication --breeze=react
  • --jetstream=STACK[,teams] to use the Laravel Jetstream starter kit. STACK may be either inertia or livewire.

    lambo new superApplication --jetstream=inertia
    lambo new superApplication --jetstream=inertia,teams
    lambo new superApplication --jetstream=livewire
    lambo new superApplication --jetstream=livewire,teams
  • --full to use --create-db, --migrate-db, --link, and -secure.

    lambo new superApplication --full
    

GitHub Repository Creation

Important: To create new repositories Lambo requires one of the following tools to be installed:

Lambo will give you the option to continue without GitHub repository creation if neither tool is installed.

  • -g or --github to Initialize a new private GitHub repository and push your new project to it.
# Repository created at https://github.com/<your_github_username>/superApplication
lambo new superApplication --github
  • Use --gh-public with --github to make the new GitHub repository public.
lambo new superApplication --github --gh-public
  • Use --gh-description with --github to initialize the new GitHub repository with a description.
lambo new superApplication --github --gh-description='My super application'
  • Use --gh-homepage with --github to initialize the new GitHub repository with a homepage url.
lambo new superApplication --github --gh-homepage=https://example.com
  • Use --gh-org with --github to initialize the new GitHub repository with a specified organization.
# Repository created at https://github.com/acme/superApplication
lambo new superApplication --github --gh-org=acme

For contributors:

Process for release

If you're working with us and are assigned to push a release, here's the easiest process:

  1. Visit the Lambo Releases page; figure out what your next tag will be (increase the third number if it's a patch or fix; increase the second number if it's adding features)

  2. On your local machine, pull down the latest version of main (git checkout main && git pull)

  3. Build for the version you're targeting (./lambo app:build)

  4. Run the build once to make sure it works (./builds/lambo)

  5. Commit your build and push it up

  6. Draft a new release with both the tag version and release title of your tag (e.g. v1.5.1)

  7. Set the body to be a bullet-point list with simple descriptions for each of the PRs merged, as well as the PR link in parentheses at the end. For example:

    - Add a superpower (#92)

  8. Hit Publish release

  9. Profit

Notes for future development

  • All new configuration keys must be added to the $newConfiguration property in UpgradeSavedConfiguration
  • All removed or deprecated configuration keys must be added to the $removedConfigurationKeys property in UpgradeSavedConfiguration
  • Any time configuration keys are changed, the $configurationVersion property in UpgradeSavedConfiguration needs to be incremented

lambo's People

Contributors

burakerdem avatar curtisblackwell avatar dependabot[bot] avatar ijpatricio avatar jasonvarga avatar jonsugar avatar josebailo avatar kraveir0 avatar lovatt avatar lukeberry99 avatar mattstauffer avatar milose avatar muhammetsait avatar naoray avatar ninjaparade avatar nowendwell avatar nunomaduro avatar ovvessem avatar peter279k avatar philip avatar quickliketurtle avatar santigarcor avatar sbine avatar sidis405 avatar vlauciani avatar wyattcast44 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lambo's Issues

Allow presets

For example:

lambo --preset=API FacebookForPets

I think that would read a separate shell script after after.sh in something like ~/.lambo/presets/API.sh.

Other examples:

lambo --preset=fractal FacebookForPets
lambo --preset=API FacebookForPets
lambo --preset=jsend FacebookForPets
lambo --preset=adminCrud FacebookForPets
lambo --preset=spark FacebookForPets

Add --dbport option

Takeout/Docker allows multiple instances/versions of MySQL to be running concurrently. We need to support specifying the port of the database server the user is targeting for a particular project.

Related: #107

Branch lampho - PHP Laravel-Zero version roadmap

Hello Matt,

So after checking https://github.com/tightenco/lambo/tree/lampho

I'm wondering why it stopped, or still didn't replace the shell version?

I can see some points

  • Was multiOS was an issue?

  • Composer global requiring was an issue because of dependencies flattening, and possible collision?
    -Would you see https://github.com/consolidation/cgr as fit?

image

But please let me know your point of view, Lambo in php/Laravel-Zero would be even more awesome, by adding few things:

  • Tests
  • Creating database optionally for the 'new' command
  • Own sqlite database to store options, and easily work with them (internal, for lambo use, in ~/.lambo)
  • Laravel console menu to interact
  • Having user Classes/Events in ~/.lambo/Events
  • Firing events after project installed, from lambo interactive menu...
    • A sub set of events could be adding predefined packages array
    • Also custom recipes... php recipes on the classes, or shell commands invoked from lambo
  • Lambo clone, for fully working projects, we could try them out, from A-Z, with this one command
    • database created, migrated, seeded, etc
    • even having a composer.json key in the repos, to process after lambo :)

I see possibilities as endless, and would contribute for sure..

Let me know what you think, please, if you have some roadmap.. Or even if you share these ideas at all, or have some others?

bash3.2 n#: command not found

Whenever I run lambo new-project the command always fails after running the after script. I get a command not found. I believe this has to do with the $SHELL command on line 395. $SHELL isn't defined anywhere in the preceeding code so i'm not exactly sure what it is trying to reference here.

if [[ "$SHELL" != "" ]]; then 
    exec "$SHELL"

When I comment out that if block, it runs to completion.

Config

#!/usr/bin/env bash

PROJECTPATH="./repos"
MESSAGE="Initial commit."
DEVELOP=false
AUTH=true
NODE=true
CODEEDITOR="atom"
BROWSER=""
LINK=true
DB_USERNAME="root"
DB_PASSWORD=""

After

#!/usr/bin/env bash

cd $PROJECTPATH/$PROJECTNAME
php artisan storage:link

Add a `.lambo` file

I'd really like to not have to pass the same config flags every time I use Lambo. I'd love to be able to define my editor and other preferences once.

Add a config method (or something like that) that allows you to edit the config interactively

Running lambo edit-config --interactive presents the user with a series of interactive questions that guide them through setting the various default options that will be saved in their ~/.lambo/config file.

$ lambo edit-config --interactive

Please specify a location where new Laravel projects should be created:
/some/path

Please choose a default editor: [vim]
[1] vim (current shell default)
[2] nano
[3] vscode
[4] Sublime Text
[5] Specify something else
1
⋮

You set the following defaults, please review them. 
You can enter 15 to save them or chose a corresponding number to edit that option.

[1] default project location: /some/path
[2] Prefered editor: vim
⋮
[15] This looks good, save them as my defaults.

Related
#115

Automatically add new options to ~/.lambo/config

When a user runs Lambo for the first time after a composer update, automatically upgrade their existing ~/.lambo/config file so that new configuration options are added with sensible defaults.

Example updated ~/.lambo/config (exact format TBD):

DB_NAME=
DB_USERNAME=root
DB_PASSWORD=

# ------------------------------------------------------------------------------
# 1-APR-2020 5:00 am (auto-generated by Lambo):
# Lambo 4.1.20 introduced new configuration options. They have been added here 
# with sensible defaults, however, you should review them.
# ------------------------------------------------------------------------------

# Open the new project in your browser.
# options:
#   true, 1, "yes" or "on" (default if not specified)
#   false, 0, "no" or "off"
OPEN_BROWSER=true

# Open the new project in the configured editor.
# options:
#   true, 1, "yes" or "on" (default if not specified)
#   false, 0, "no" or "off"
OPEN_EDITOR=true

Example output when running Lambo for the first time after a composer update (exact format TBD):

Your Lambo configuration (~/.lambo/config) has been updated with new options 
introduced in Lambo <version>, please review them.

Do you want to review them now? [yes]
[1] yes
[2] no
[3] remind me later

Refactor UI scaffolding API

Remove --node and --mix

  • run asset install and compilation automatically for inertia installs.

Files to check

  • \App\Actions\InstallNpmDependencies
  • \App\Commands\Debug
  • \App\Commands\NewCommand
  • \App\Configuration\LamboConfiguration
  • \App\Configuration\SetConfig
  • \App\Options
  • \Tests\Feature\InstallNpmDependenciesTest
  • \Tests\Unit\SetConfigTest

Change user API

  • Remove references to --auth
  • Replace --frontend=<stack> with --inertia and --livewire and ensure that only one of either only one option is provided. Give appropriate feedback if not.

Investigate --api option

Given the release of Laravel Jetstream (Inertia/Livewire) and tools like Laravel Blueprint, what does Laravel API development look like in 2020 and how can Lambo best support it 🤔 ?

Original issue description from @devmsh:

It sill be awesome if you add --api option than default the new Laravel project to the best options for a fully API application that did not contain any sort of UI.

Add --migrate option

With Laravel Jetstream, the homepage produces an error when opening in the browser. It requires the database to have been migrated. Currently, there is no option for Lambo to migrate the database.

Will need to check database is installed and available. See, App\Actions\CreateDatabase

Q: Is there an opportunity to extract this to a global action that can be used by presets 🤔 ?

Related: #112

Error creating project

Following directions from "Laravel: Up and Running, 2nd Edition". I get errors running it, and a a different set of files (from the book). Output is like so:


Creating new Laravel app tourney


Crafting application...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file

[ErrorException]
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] []...

Application ready! Build something amazing.

After this is a bunch of git checkin stuff.

Then I notice different list of files (from book). Most are same, but most glowingly missing is the vendor directory. i'm hesitant to do a composer install because I'm not sure if the above error will cause issues.

Am I missing something ??
(New to Laravel, I hope the benefits outweigh the headaches of setting up)

Add option for "cleaning" Laravel cruft

Maybe, --remove-comments / --without-comments 🤔

E.g. run this wonderful script by @jakebathman to delete all the comments:

<?php
/*
|--------------------------------------------------------------------------
| Remove Laravel Comments
|--------------------------------------------------------------------------
|
| Just made a new Laravel project, but don't want all those big 
| comment blocks? Put this in the root of your project and run
| "php remove_laravel_comments.php"
|
*/$directories = [
  'app',
  'bootstrap',
  'config',
  'database',
  'resources',
  'routes',
  'tests',
];
​
$base = './';
​
foreach ($directories as $dir) {
  $it = new RecursiveDirectoryIterator($base . $dir);
  foreach (new RecursiveIteratorIterator($it) as $file) {
    if ($file->getExtension() == 'php') {
      echo "Removing comments from: " . $file->getRealPath() . "\n";
      $contents = file_get_contents($file->getRealPath());
      $new = preg_replace('/^(\{?)\s*?\/\*(.|[\r\n])*?\*\/([\r\n]+$|$)/im', '$1', $contents);
      file_put_contents($file->getRealPath(), $new);
    }
  }
}

Support Windows and Linux operating systems

Detail to resolve

Linux

What Linux distros should we support?

The community Valet for Linux port is flaky, do we support it or do something else?

Windows

Do we even support Windows?

A: Maybe we just advise the use of Laragon.
A: Maybe support is indirect through WSL and Lambo's supported Linux distros.

What Windows versions should we support?

A: Only those that have WSL/WSL2?

How do we replace valet functionality?

A We don't (at least for launch of official compatibility)

Composer output appearing as "errors" even though they aren't errors

Pinging @jonsugar @mattstauffer

I mentioned on the stream that at the end of any composer call, to add 2>&1 to output, and it will still spit everything out from composer, but to stdout instead of stderr.

@mattstauffer had mentioned using --quiet on composer calls, which would work, but you couldn't see the install output if you wanted.

Maybe it would be a good idea to always do 2>&1 and then have an option to have lambo pass --quiet to composer calls?

(As I closed the twitch window, I noticed @jonsugar had said something, but I missed what, so I figured I'd share here so there can be a discussion on the best option)

Add an --interactive option that prompts you for all of the specific details in menu

Running lambo --interactive presents the user with a series of interactive questions that guide them through setting the various options available.

Example (exact format TBD):

#assumming current directory is /Users/jondoe/Sites
$ lambo --interactive

What would you like to name your new project?
my-project

Where would you like to create your new Laravel project? [here]
[1] here (/Users/jondoe/Sites/my-project)
[2] default root directory configured in ~/.lambo/config (/some/path/my-project)
[3] Specify a path
2

[ OK ] Your new project will be located at /some/path/my-project
⋮

Related
#114

Suggestion: New Help as One for All

Updated!

Hi, I would like to contribute by PR but not fully in control with the code structure at the moment, So I thought i could still make some suggestions.

The help function we talk on the live streaming, I think that could be something like this:

I believe we can convert DisplayHelpScreen class to handle lambo's and preset's help dynamically just passing the parameters to display.

DisplayHelpScreen class can accept usages, commands,options and flags each as array with description if needed and display them on condition if received.

Take a look at the concept code:

namespace App\Actions;

use App\Options;

class DisplayHelpScreen
{
    use LamboAction;

    protected $indent = 30;
    public $content = [];

    public function __construct($bindings = [])
    {
        foreach ($bindings as $key => $value) {
            $this->content[$key] = $value;
        }

        $this->display();
    }

    public function display()
    {
        foreach ($this->content as $key => $values) {
            $this->line("\n<comment>{$key}:</comment>");

            $values = is_array($values) ? $values : str_split($values);

            foreach ($values as $command => $description) {
                 $spaces = $this->makeSpaces(strlen($command));
                 $this->line("  <info>{$command || ''}</info>{$spaces}{$description}");
            }
        }
    }

    private function createCliStringForOption($option)
    {
        if (isset($option['short'])) {
            $flag = '-' . $option['short'] . ', --' . $option['long'];
        } else {
            $flag = '    --' . $option['long'];
        }

        if (isset($option['param_description'])) {
            $flag .= '=' . $option['param_description'];
        }

        $spaces = $this->makeSpaces(strlen($flag));
        $description = $option['cli_description'];

        return "  <info>{$flag}</info>{$spaces}{$description}";
    }

    public function makeSpaces($count)
    {
        return str_repeat(" ", $this->indent - $count);
    }
}


class Telescope
{
    public $usages = [
        '--preset=[preset]',
        '--preset=[preset]:[command]',
        '--preset=[preset]:[command]|[option]',
        '--preset=[preset]:[command]|[option]--[flag]',
    ];

    public $commands = [
        '[command1]' => '[description]',
        '[command2]' => '[description]',
    ];

    public $options = [
        '[option1]' => '[description]',
        '[option2]' => '[description]',
    ];

    public $flags = [
        '[flag1]' => '[description]',
        '[flag2]' => '[description]',
    ];

    public function help()
    {
        new DisplayHelpScreen([
            'usages'  => $this->usages,
            'commands'=> $this->commands,
            'options' => $this->options,
            'flags'   => $this->flags
        ]);
    }
}

(new Telescope())->help();

and lambo could use same way as any other presets. So this way, we could have a help template that displays different information for any use case. Passing the parameters could be done in a better way.

I didn't describe it too detailed because i think the idea is clear. It's a concept and i believe there is a lot of room to improve.
Thx

Handling applications that already exist

Feature request to handle the following exception:

 [RuntimeException]
  Application already exists!

How? I'm not sure. Maybe add --force to continue doing the stuff that's not laravel new *, otherwise exit with a friendly message. Not sure if it should also completely replace the directory.

Postgresql support

Hi @mattstauffer, I read about Lambo from your excellent Laravel book.

Actually there is support only for mysql.

Are you thinking of implementing also Postgres as an alternative?

Also could be interesting to add direct support for this TALL preset

What you think? Can I be of some help?

Improve MySQL database detection and creation

A better way to test for MySQL being available is to use a mysqli connection.

Compared to the current implementation, this has the advantages of:

  • not requiring the MySQL client to be installed.
  • will work with non-local databases.
  • will work on Windows and Linux.

Test for MySQL server availablity

<?php
$servername = "127.0.0.1";
$username = "root";
$password = "";
$port = 3306;

// Create connection
$conn = new mysqli($servername, $username, $password, null, $port);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
$conn->close();

Create a new database

// Create database
$sql = "CREATE DATABASE {$dbname}";

if ($conn->query($sql) === TRUE) {
    echo "Database created successfully";
} else {
    echo "Error creating database: " . $conn->error;
}

Add a post execution summary of what lambo has done

Once all steps have completed, show the user a summary of what has been completed.

Consider running lambo new my-app --full -v. A lot of output will quickly scroll by and the user may miss warnings or other useful feedback from Lambo.

The idea here is to surface any such messages while also reinforcing the steps successfully completed.

for example (exact format TBD):

⋮
Completed successfully with warnings:

[ WARN ] Your MySQL server is not running so I skipped database creation.
         Start your MySQL server and add the database manually.
[ WARN ] Your MySQL server is not running so I skipped database migration.
         Start your MySQL server and run database migrations manually.

Summary
=======

✓ Created new project 'foo' at ~/Sites/foo
✓ Valet is serving your site securely at https://foo.test
✓ Inertia scaffolding installed
✓ All javascript dependencies installed and compiled.
✗ Database migrated

Done, happy coding!
Lambo is bought to you by the lovely folks at Tighten.

Allow Initial commit to be empty

I am a big believer of the initial commit being empty: git commit --allow-empty -m 'Initial Commit'. This should occur immediately after the git init. This would then be followed with the git add . and the git commit -m $MESSAGE as found in line 307.

I can quickly create a PR if this would be considered.

sed error read .env

I have Ubuntu 16.04-1 with russian locale, but I'll translate for you.

den@probook ~/projects[0] $ lambo lamboApp

***********************************************
Creating new Laravel app lamboApp
***********************************************

Crafting application...
sh: composer: команда не найдена
Application ready! Build something amazing.
Инициализирован пустой репозиторий Git в /home/den/projects/lamboApp/.git/
[master (корневой коммит) 186e228] Initial commit.
 80 files changed, 6340 insertions(+)
 create mode 100644 .env.example
 create mode 100644 .gitattributes
 create mode 100644 .gitignore
 create mode 100644 app/Console/Kernel.php
 create mode 100644 app/Exceptions/Handler.php
 create mode 100644 app/Http/Controllers/Auth/ForgotPasswordController.php
 create mode 100644 app/Http/Controllers/Auth/LoginController.php
 create mode 100644 app/Http/Controllers/Auth/RegisterController.php
 create mode 100644 app/Http/Controllers/Auth/ResetPasswordController.php
 create mode 100644 app/Http/Controllers/Controller.php
 create mode 100644 app/Http/Kernel.php
 create mode 100644 app/Http/Middleware/EncryptCookies.php
 create mode 100644 app/Http/Middleware/RedirectIfAuthenticated.php
 create mode 100644 app/Http/Middleware/VerifyCsrfToken.php
 create mode 100644 app/Providers/AppServiceProvider.php
 create mode 100644 app/Providers/AuthServiceProvider.php
 create mode 100644 app/Providers/BroadcastServiceProvider.php
 create mode 100644 app/Providers/EventServiceProvider.php
 create mode 100644 app/Providers/RouteServiceProvider.php
 create mode 100644 app/User.php
 create mode 100644 artisan
 create mode 100644 bootstrap/app.php
 create mode 100644 bootstrap/autoload.php
 create mode 100644 bootstrap/cache/.gitignore
 create mode 100644 composer.json
 create mode 100644 composer.lock
 create mode 100644 config/app.php
 create mode 100644 config/auth.php
 create mode 100644 config/broadcasting.php
 create mode 100644 config/cache.php
 create mode 100644 config/compile.php
 create mode 100644 config/database.php
 create mode 100644 config/filesystems.php
 create mode 100644 config/mail.php
 create mode 100644 config/queue.php
 create mode 100644 config/services.php
 create mode 100644 config/session.php
 create mode 100644 config/view.php
 create mode 100644 database/.gitignore
 create mode 100644 database/factories/ModelFactory.php
 create mode 100644 database/migrations/.gitkeep
 create mode 100644 database/migrations/2014_10_12_000000_create_users_table.php
 create mode 100644 database/migrations/2014_10_12_100000_create_password_resets_table.php
 create mode 100644 database/seeds/.gitkeep
 create mode 100644 database/seeds/DatabaseSeeder.php
 create mode 100644 gulpfile.js
 create mode 100644 package.json
 create mode 100644 phpunit.xml
 create mode 100644 public/.htaccess
 create mode 100644 public/css/app.css
 create mode 100644 public/favicon.ico
 create mode 100644 public/index.php
 create mode 100644 public/js/app.js
 create mode 100644 public/robots.txt
 create mode 100644 readme.md
 create mode 100644 resources/assets/js/app.js
 create mode 100644 resources/assets/js/bootstrap.js
 create mode 100644 resources/assets/js/components/Example.vue
 create mode 100644 resources/assets/sass/app.scss
 create mode 100644 resources/assets/sass/variables.scss
 create mode 100644 resources/lang/en/auth.php
 create mode 100644 resources/lang/en/pagination.php
 create mode 100644 resources/lang/en/passwords.php
 create mode 100644 resources/lang/en/validation.php
 create mode 100644 resources/views/errors/503.blade.php
 create mode 100644 resources/views/vendor/.gitkeep
 create mode 100644 resources/views/welcome.blade.php
 create mode 100644 routes/api.php
 create mode 100644 routes/console.php
 create mode 100644 routes/web.php
 create mode 100644 server.php
 create mode 100644 storage/app/.gitignore
 create mode 100644 storage/app/public/.gitignore
 create mode 100644 storage/framework/.gitignore
 create mode 100644 storage/framework/cache/.gitignore
 create mode 100644 storage/framework/sessions/.gitignore
 create mode 100644 storage/framework/views/.gitignore
 create mode 100644 storage/logs/.gitignore
 create mode 100644 tests/ExampleTest.php
 create mode 100644 tests/TestCase.php
sed: невозможно прочитать .env: Нет такого файла или каталога
sed: невозможно прочитать .env: Нет такого файла или каталога
sed: невозможно прочитать .env: Нет такого файла или каталога
sed: невозможно прочитать .env: Нет такого файла или каталога

sed: can't read .env: File or directory doesn't exist

It isn't actually an error, but I suppose something happened.
🍻

[Feature] Lambo clone

Hi Tighten!

Just submitted #52 in order to create database as of project creation. Hope you like it as just as me 😃

Would you like to see a "lambo clone"? (i will gladly do it)

For repositories that are sample apps, or boilerplates...

lambo clone <repo-url>

Would do as the lambo now, adding the create database, and if it didn't exist before, would migrate and seed

So after the clone, we could have the editor opening the project, and the browser opening the already working application!

What do you think on that?

Editor opens before yarn runs

When creating a new site the editor is opened before yarn is ran, this doesn't cause an issue when using editors such as PHPStorm or Sublime, but when using vim this halts the rest of the setup process until vim has been closed. This means that yarn doesn't run, auth scaffolding doesn't run and any lambo-after config doesn't run either.

lambo edit-config throws error

When running lambo edit-config or lambo edit-after i get the following error:

In Filesystem.php line 52:

File does not exist at path phar:///Users/s.spaan/.composer/vendor/tightenco/lambo/builds/lambo/stubs/config.stub
In Filesystem.php line 52:

File does not exist at path phar:///Users/s.spaan/.composer/vendor/tightenco/lambo/builds/lambo/stubs/after.stub

Running version v1.0.0-alpha3

Proposal: After script

Proposal:
Add check for after script to allow additional commands after main Lambo script is complete.

Background:
There were 2 suggestions from issue #25

  1. Maybe it would be nice to have a ~/.lambo/includes folder with files to copy / overwrite on every new project. For example .editorconfig, .eslint, .travis.yml; or sometimes, you want to overwrite the original .gitignore file. @milose
  2. I'd love to add "packages to include every time i spin up a new app", which would run composer require for each package . @mattstauffer

Details:
I propose simply adding a check for a ~/.lambo/after file and including it.

if [[ -f ~/.lambo/after ]]; then
    echo "Running additional commands"
    source ~/.lambo/after
fi

The after file would be a plain bash script so you could do 'anything' here.

Example after file for use case 1:

#!/usr/bin/env bash

echo "Copying Files"
cp -R ~/.lambo/includes/ $PROJECTPATH

Example after file for use case 2:

#!/usr/bin/env bash

echo "Installing composer dependencies"
composer require tightenco/mailthief tightenco/quicksand

Any feedback on this approach?

We could add a make and edit command (like config has) and include a sample command commented out to give people some ideas... better than a blank slate i think.

Thanks.

Write really simple docs for the beta

Keep existing readme
Block up top that says "FOR BETA TESTERS"
And very briefly shares just the differences between the non-beta docs below and the beta.

Drop laravel/installer requirement?

Could you not use

composer create-project laravel/laravel $PROJECTNAME --prefer-dist

rather than

laravel new $PROJECTNAME

allowing you to drop the requirement for a globally installed Laravel installer?

Or, (I don't know if this would work but I don't see why it wouldn't) make laravel/installer a dependency of tightenco/lambo and run it from the lambo bin dir rather than have that extra global dependency?

Error: Undefined property: stdClass::$tld

It's basically same problem as described in #61 but the other way around. If I edit lambo to use domain instead of tld I don't get any errors.

Changing these lines to the following would do the fix to enable both tld and domain configs from valet:

if [[ -f ~/.config/valet/config.json ]]; then
    TLD=$(php -r "echo property_exists(json_decode(file_get_contents('$HOME/.config/valet/config.json')), 'tld') ? json_decode(file_get_contents('$HOME/.config/valet/config.json'))->tld : json_decode(file_get_contents('$HOME/.config/valet/config.json'))->domain;")
else
    TLD=$(php -r "echo property_exists(json_decode(file_get_contents('$HOME/.valet/config.json')), 'tld') ? json_decode(file_get_contents('$HOME/.valet/config.json'))->tld : json_decode(file_get_contents('$HOME/.valet/config.json'))->domain;")
fi

but it looks very messy... Maybe someone could improve this code? I am unfamiliar with bash script and couldn't figure out how to work with php vars inside the script...

RE Ternary todo

Regarding https://github.com/tightenco/lambo/blob/master/lambo#L114

prettyPath=$([ "$PROJECTPATH" == "." ] && \
    echo "$PROJECTNAME" || \
    echo "$PROJECTPATH/$PROJECTNAME")

[[ $PROJECTPATH = "." ]] && \
    prettyPath="$PROJECTNAME" || \
    prettyPath="$PROJECTPATH/$PROJECTNAME"

case $PROJECTNAME in
 .) prettyPath="$PROJECTNAME" ;;
 *) prettyPath="$PROJECTPATH/$PROJECTNAME" ;;
esac

Some syntax choices for you. Can PR later if needs be.

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.