PHP code example of codedreamer / footprint

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

    

codedreamer / footprint example snippets




use Footprint;

// log trail
public function index(Request $request){
	Footprint::logTrail($request);
	return view('welcome');
}

// log trail with description
public function task(Request $request){
	$request->description = "Task manager";
	Footprint::logTrail($request);
	return view('task');
}



 'providers' => [
    App\Providers\RouteServiceProvider::class,
    Codedreamer\Footprint\FootprintServiceProvider::class,
    ..................
 ]

 'aliases' => [
    'View' => Illuminate\Support\Facades\View::class,
    'Footprint' => Codedreamer\Footprint\Facades\Footprint::class,
    ..................
 ]




namespace App\Http\Middleware;

use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Footprint;

class Authenticate extends Middleware
{
    /**
     * Get the path the user should be redirected to when they are not authenticated.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return string|null
     */
    protected function redirectTo($request)
    {
        // log trail
        Footprint::logTrail($request);

        if (! $request->expectsJson()) {
            return route('login');
        }
    }
}




namespace App\Http\Middleware;

use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Footprint;

class LoginController extends Controller
{
    // an example
    protected function login($request)
    {
        // log trail
        Footprint::logTrail($request);

        // code here...
    }
}


$ php artisan vendor:publish --provider="Codedreamer\Footprint\FootprintServiceProvider"


$ php artisan migrate