PHP code example of riponcoder / file-upload

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

    

riponcoder / file-upload example snippets

sh
php artisan migrate
sh
    public function Insert(Request $request){
        $post = new Post();
        $post->title = $request->title;
        $post->save();
        FileUpload::path('ripon/sajib')->uploadWithDb($post,$request->image);

        // Access For
         $post =  Post::find(3);
         return $post->imageabble;
    }
        
sh
    public function Update(Request $request){
        $post = new Post();
        $post->title = $request->title;
        $post->save();
        FileUpload::path('ripon/sajib')->updateWithDb($post,$request->image);

        // Access For
         $post =  Post::find(3);
         return $post->imageabble;
    }
sh
  FileUpload::path("dynamic-assets/admin-avatar")->removeFile($admin->image ?? '')->uploadFile($request->image);