PHP code example of ayup-creative / laravel-stub-maker

1. Go to this page and download the library: Download ayup-creative/laravel-stub-maker 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/ */

    

ayup-creative / laravel-stub-maker example snippets


use Ayup\LaravelStubMaker\Concerns\MakesStubs;

$stub = $this->stub('MyClass')
            ->extends('\\App\\Examples\\ExampleClass');

echo $stub;

// "App\MyClass"

echo $stub->output();

// 
// 
// namespace App;
// 
// use \App\Examples\ExampleClass;
// 
// class MyClass extends ExampleClass
// {}

$stub = $this->stub('UserRepositoryInterface')
    ->interface()
    ->extends('\\App\\Contracts\\RepositoryInterface')
    ->output();

use Ayup\LaravelStubMaker\Constructor;
use Ayup\LaravelStubMaker\Argument;

$stub->constructor(
        Constructor::make([
            Argument::make('model')->protected()->hint(\Illuminate\Database\Eloquent\Model::class)
        ])
    );