PHP code example of jornatf / laravel-trait-generator
1. Go to this page and download the library: Download jornatf/laravel-trait-generator 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/ */
jornatf / laravel-trait-generator example snippets
namespace App\Traits;
trait Foo
{
/**
* Method description.
*
* @return string
*/
public function methodName()
{
return "Hello World";
}
}
namespace App\Http\Controllers;
use App\Traits\Foo;
use App\Http\Controllers\Controller;
class PostController extends Controller
{
use Foo;
// your controller methods HERE.
}
bash
php artisan make:trait Foo