Skip to content

Instantly share code, notes, and snippets.

@rockdrigo
Last active May 30, 2018 05:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rockdrigo/d7f456fd1abba85af0517c860b247231 to your computer and use it in GitHub Desktop.
Save rockdrigo/d7f456fd1abba85af0517c860b247231 to your computer and use it in GitHub Desktop.
Call laravel controller methods via command line Raw
<?php
php artisan tinker
$controller = app()->make('App\Http\Controllers\MyController');
app()->call([$controller, 'myMethodName'], []);
//the last [] in the app()->call() can hold arguments such as [user_id] => 10 etc'
//otra forma para jalar directamente al metodo
app()->call('App\Http\Controllers\MyController@myMethodName');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment