Skip to content

Commit

Permalink
Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
irfaardy committed Nov 23, 2020
1 parent 2f63408 commit 05c209e
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 35 deletions.
95 changes: 63 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@

# 🚀Simple Laravel Encrypt Upload File
[![GitHub license](https://img.shields.io/github/license/irfaardy/encrypt-file-laravel?style=flat-square)](https://github.com/irfaardy/encrypt-file-laravel/blob/master/LICENSE) [![Support me](https://img.shields.io/badge/Support-Buy%20me%20a%20coffee-yellow.svg?style=flat-square)](https://www.buymeacoffee.com/OBaAofN)

<p>The Simple Laravel Encrypt Upload File uses the default encryption of Laravel which is implemented in upload file.<p>
# 🚀Lisensi aplikasi untuk server endpoint

[![GitHub license](https://img.shields.io/github/license/irfaardy/encrypt-file-laravel?style=flat-square)](https://github.com/irfaardy/encrypt-file-laravel/blob/master/LICENSE) [![Support me](https://img.shields.io/badge/Support-Buy%20me%20a%20coffee-yellow.svg?style=flat-square)](https://www.buymeacoffee.com/OBaAofN) [![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/S6S52P7SN)

<p>Plugin ini berfungsi untuk membuat serial number yang akan diakses menggunakan plugin <a href="https://github.com/irfaardy/app-license-client">https://github.com/irfaardy/app-license-client</a><p>
<h3>🛠️ Installation with Composer </h3>

composer require irfa/encrypt-file-laravel

composer require irfa/app-license-server

>You can get Composer [ here]( https://getcomposer.org/download/)
Expand All @@ -18,7 +21,7 @@

'providers' => [
....
Irfa\FileSafe\FileSafeServiceProvider::class,
Irfa\AppLicenseServer\AppLicenseServerServiceProvider::class,
];


Expand All @@ -27,61 +30,89 @@

'aliases' => [
....
'FileSafe' => Irfa\FileSafe\Facades\FileSafe::class,
'ALS' => Irfa\AppLicenseServer\Facades\AppLicenseServer::class,

],

<h2>Publish Vendor</h2>


php artisan vendor:publish --tag=file-safe
php artisan vendor:publish --tag=app-license-server

<h2>Run Migration</h2>

```
php artisan migrate
```

<h2>Config File</h2>

config/irfa/filesafe.php
config/irfa/app_license_server.php

<h2>Example store file</h2>
<h2>Inside Config File</h2>


<?php
<?php<?php
return [

namespace App\Http\Controllers;
'hashed' => false,//Hashed Serial number,

use Filesafe;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
'caching_license' => true,//Generate random alnum for upload filename,

class FileController extends Controller
{
public function upload_file(Request $request)
{
$file = $request->file('file');
FileSafe::store($file);
//This is to encrypt the file before it is uploaded to the server.

}
}
'license_route' => "/check/license",

'route_name' => "check_license",

'length' => 4, //length char per segment

'segment' => 4,


];

<h2>Example download file</h2>
<h2>Register New Serial Number License</h2>


<?php

namespace App\Http\Controllers;

use FileSafe;
use ALS;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class FileController extends Controller
class LicenseController extends Controller
{
public function upload_file(Request $request)
public function register(Request $request)
{
$file = 'encrypted_file.doc';
return FileSafe::download($file);
//This is to decrypt files to be downloaded.
return ALS::register(['name'=>"Lorem",
'domain'=>"example.com",
'phone_number'=>"08123123",
'address'=>"Bandung,Indonesia"],now()->addDays(30));
}
}

<h2> Check License</h2>

```
<?php
namespace App\Http\Controllers;
use ALS;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class LicenseController extends Controller
{
public function check(Request $request)
{
return ALS::serial($request->serial)->check();
}
}
```

6 changes: 3 additions & 3 deletions src/Func/License.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ public function serial($serial)

public function disable()
{

//Coming soon
}

public function enable()
{

//Coming soon
}

public function renew($date)
{

//Coming soon
}

public function check()
Expand Down

0 comments on commit 05c209e

Please sign in to comment.