PHP code example of berthott / laravel-targetable

1. Go to this page and download the library: Download berthott/laravel-targetable 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/ */

    

berthott / laravel-targetable example snippets


class TestService extends TargetableService
{
    public function __construct()
    {
        parent::__construct(YourTrait::class, 'your-config');
    }
}



use HaydenPierce\ClassFinder\ClassFinder;

return [

    /*
    |--------------------------------------------------------------------------
    | Model Namespace Configuration
    |--------------------------------------------------------------------------
    |
    | string or array with one ore multiple namespaces that should be monitored 
    | for the configured trait. Defaults to App\Models.
    |
    */

    'namespace' => 'App\Models',

    /*
    |--------------------------------------------------------------------------
    | Model Namespace Search Option
    |--------------------------------------------------------------------------
    |
    | Defines the search mode for the namespaces. ClassFinder::STANDARD_MODE
    | will only find the exact matching namespace, ClassFinder::RECURSIVE_MODE
    | will find all subnamespaces. Defaults to ClassFinder::STANDARD_MODE.
    | 
    | Beware: ClassFinder::RECURSIVE_MODE might cause some testing issues.
    |
    */

    'namespace_mode' => ClassFinder::STANDARD_MODE,

    /*
    |--------------------------------------------------------------------------
    | Route Prefix
    |--------------------------------------------------------------------------
    |
    | Defines the route prefix. Defaults to 'api'.
    |
    */

    'prefix' => 'api',
];