PHP code example of iwedmak / helper

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

    

iwedmak / helper example snippets


iWedmak\Helper\Middleware\FormatResponce::class,

return ['data'=>$data, 'view'=>'someview'];

$response = $next($request);
try
{
    if (method_exists($response, 'getOriginalContent')) 
    {
        $data = $response->getOriginalContent();
        if(isset($data['data']) && !empty($data['data']))
        {
            if ($request->wantsJson()) 
            {
                $response=response()->json($data['data']);
                $response->header('Content-Length',mb_strlen($response->getContent()));
            } 
            else 
            {
                $response=response()->view($data['view'], $data['data']);
            }
        }
    }

}
catch(BadMethodCallException $e)
{

}
return $response;

iWedmak\Helper\Providers\CacheServiceProvider::class,

'xcache' => [
    'driver' => 'xcache',
],