PHP code example of smarch / watchtower

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

    

smarch / watchtower example snippets

       
       /*
        * Third Party Service Providers
        */
        Caffeinated\Shinobi\ShinobiServiceProvider::class, // For RBAC
        Collective\Html\HtmlServiceProvider::class, // For Watchtower Forms to function
        Smarch\Watchtower\WatchtowerServiceProvider::class, // For Watchtower
       
        /*
        * Third Party Service Providers
        */
        'Form'     => Collective\Html\FormFacade::class,  // nobi\Facades\Shinobi::class, // For RBAC functions
        //'Watchtower'=> Smarch\Watchtower\WatchtowerFacade::class, // not 


    
    namespace App;

    use Illuminate\Auth\Authenticatable;
    use Illuminate\Database\Eloquent\Model;
    use Illuminate\Auth\Passwords\CanResetPassword;
    use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
    use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;

    use Caffeinated\Shinobi\Traits\ShinobiTrait;

    class User extends Model implements AuthenticatableContract,
                                        CanResetPasswordContract
    {
        use Authenticatable, CanResetPassword, ShinobiTrait;



    
    
    namespace App;
    
    use Illuminate\Notifications\Notifiable;
    use Illuminate\Foundation\Auth\User as Authenticatable;
    
    use Caffeinated\Shinobi\Traits\ShinobiTrait;
    
    class User extends Authenticatable
    {
        use Notifiable;
        use ShinobiTrait;
        


	// Authentication routes...
	Route::get('auth/login', 'Auth\AuthController@getLogin');
	Route::post('auth/login', 'Auth\AuthController@postLogin');
	Route::get('auth/logout', 'Auth\AuthController@getLogout');
	
	// Registration routes...
	Route::get('auth/register', 'Auth\AuthController@getRegister');
	Route::post('auth/register', 'Auth\AuthController@postRegister');
	
	// Password reset link request routes...
	Route::get('password/email', 'Auth\PasswordController@getEmail');
	Route::post('password/email', 'Auth\PasswordController@postEmail');
	
	// Password reset routes...
	Route::get('password/reset/{token}', 'Auth\PasswordController@getReset');
	Route::post('password/reset', 'Auth\PasswordController@postReset');
bash
    php artisan vendor:publish
    php artisan migrate