PHP code example of christophrumpel / laravel-command-file-picker
1. Go to this page and download the library: Download christophrumpel/laravel-command-file-picker library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
christophrumpel / laravel-command-file-picker example snippets
use Illuminate\Console\Command;
class MyLaravelCommand extends Command
{
use PicksClasses;
//...
}
$modelClass = $this->askToPickClasses(base_path('app/Models'));
$models = $this->askToPickModels();
use Illuminate\Console\Command;
class MyLaravelCommand extends Command
{
use PicksFiles;
//...
}
$files = $this->askToPickFiles(base_path('app/Models'));
$files = $this->askToPickFiles(base_path('app/Models'), function(array $fileInfo) {
return rand(0,1);
});
$files = $this->askToPickFiles(base_path('app/Models'), $filterCallable, $showAllOption);