Answers for "laravel use controller in command"

3

laravel create controller command

php artisan make:controller UserController
Posted by: Guest on June-01-2020
0

laravel run controller from command line

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Http\Controllers\HelloWorldController;

class MakeImportsCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'helloworld';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Say Hello World Controller';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        return $this -> helloWorld();

    }
}
Posted by: Guest on February-02-2021

Code answers related to "laravel use controller in command"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language