Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php file storage

}



    /**

     * Remove the specified resource from storage.

     *

     * @param  AppModelsinvoices_details  $invoices_details

     * @return IlluminateHttpResponse

     */

    public function destroy(Request $request)

    {

        $invoices = invoices_attachments::findOrFail($request->id_file);

        $invoices->delete();

        Storage::disk('public_uploads')->delete($request->invoice_number.'/'.$request->file_name);

        session()->flash('delete', 'تم حذف المرفق بنجاح');

        return back();

    }

    public function get_file($invoice_number,$file_name)



    {

        $contents= Storage::disk('public_uploads')->getDriver()->getAdapter()->applyPathPrefix($invoice_number.'/'.$file_name);

        return response()->download( $contents);

    }

    public function open_file($invoice_number,$file_name)



    {

        $files = Storage::disk('public_uploads')->getDriver()->getAdapter()->applyPathPrefix($invoice_number.'/'.$file_name);

        return response()->file( $files);

    }

}
Comment

PREVIOUS NEXT
Code Example
Php :: php input radio 
Php :: laravel array to string conversion 
Php :: where is in array laravel 
Php :: laravel import xml to database 
Php :: laravel resource 
Php :: laravel create table if not exists 
Php :: laravel collection get 
Php :: php max int 
Php :: php and ajax on select option 
Php :: php api 
Php :: Laravel return empty relationship on model when condition is true 
Php :: defining route through controller 
Php :: How do I log properly a Laravel Job 
Php :: what is Laravel Eloquent ORM. 
Php :: How to Get Radio Button Value in PHP Without Submit 
Php :: download file using jquery php 
Php :: timezones php 
Php :: php create html code 
Php :: Override the route parameter names 
Php :: select randomly from mysqli php 
Php :: laravel move/rename file ftp 
Php :: Form::select laravel 
Php :: put the date from new york with php 
Php :: wordpress how to display breadcrumb in child theme programmatically 
Php :: turn off wordpress user list exposed 
Php :: php simple sse 
Php :: composer require rtconner/laravel-tagging 
Php :: tinker laravel 8 
Php :: render html data from db laravel 
Php :: check email veriy or not laravel 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =