PHP code example of reyjhon / simple-php

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

    

reyjhon / simple-php example snippets


return view('welcome');

return view('your_folder.welcome');

return view('welcome', [], 'normal');

   public function index()

public function indexAction()

use App\Helper\Auth\AuthHelper as auth;
use Simple\Request;

    public function before()
    {
        if(!auth::user()) {
           Request::redirect('/auth/index');
        }
    }

public function store(Request $request)
{
   $file = $request->file('profile_photo'); // profile_photo is the field name of the input type="file" element
   $file->upload('folder_name'); // specify the folder where the file is going to store, if upload success it wil return true otherwise false.
}

use Simple\Security\SimplyEncrypt;

$encrypted = SimplyEncrypt::encrypt('secret text');

use Simple\Security\SimplyDecrypt;

$decrypted = SimplyDecrypt::decrypt($ciphertext);

dd($var)

composer create-project reyjhon/simple-php
cd simple-php

php cli key:generate