Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix post-update-cmd with --no-dev installs #1067

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,47 @@ You can use an in-memory SQLite driver by adding the `-M` option.
You can choose to include helper files. This is not enabled by default, but you can override it with the `--helpers (-H)` option.
The `Illuminate/Support/helpers.php` is already set up, but you can add/remove your own files in the config file.

#### Cooperation with release builds
Create a file `app/Console/Commands/IdeHelperDoIt.php`:
```php
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;

class IdeHelperDoIt extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'ide-helper:do-it';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Run barryvdh/laravel-ide-helper';

public function handle()
{
if ('local' === config('app.env', 'production')) {
Artisan::call('ide-helper:generate');
Artisan::call('ide-helper:meta');
Artisan::call('ide-helper:models', ['--nowrite' => true]);
}
}
}
```

In `composer.json` you can then add `"@php artisan ide-helper:do-it"` that will gracefully work indepent of `--no-dev` composer installs.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it should be more explicit where to add this, as they're multiple keys possible in scripts, i.e. mention post-update-cmd ?


It checks wether `APP_ENV="local"` is in `.env`. You can change that to match your setup.

### Automatic PHPDoc generation for macros and mixins

This package can generate PHPDocs for macros and mixins which will be added to the `_ide_helper.php` file.
Expand Down