Tag : response()


Response download with file in Laravel 5.3 example

We sometimes require to return response with download file from controller method like generate invoice and give to download or etc. Laravel 5 provide us response() with download method that way we can do it. In First argument of download() we have to give path of download file. We can rename of download file by passing second argument of download(). We can also set headers of file by passing third argument. In bellow example will help you how it is works. So, first i am going to create new route for our example as like bellow: <strong>routes/web.php</strong> <pre class="prettyprint lang-ph.....

By Hardik Savani | September 21, 2016 | | 3352 Viewer | Category : Laravel
READ MORE

Laravel 5 json response from controller example

If you are working with REST API then you always need to return json data response that way front-end developer can handle it easily. i created bellow controller method in this method i return json array response, that way you can understand very well. laravel 5 provide response() helper and it will help to response of json object. But if you are working on Core PHP then you have to do json_encode before send output. In laravel you can do it easily like this way: <strong>Example:</strong> <pre class="prettyprint lang-php"> public function getJsonData() { $myArray = ['id'=>1, 'name'=>'HD'];.....

By Hardik Savani | May 11, 2016 | | 1833 Viewer | Category : Laravel
READ MORE

    Solved - opencart this merchant is not enabled for auth/settle

    Solved - opencart this merchant is not enabled for auth/settle

    Open Post

    Laravel 5 Redirect to URL using redirect() helper

    Laravel 5 Redirect to URL using redirect() helper

    Open Post

    Laravel 5.4 - send email using Markdown Mailables

    Laravel 5.4 - send email using Markdown Mailables

    Open Post

    Laravel 5 - Dynamic Dependant Select Box using JQuery Ajax Example - Part 2

    Laravel 5 - Dynamic Dependant Select Box using JQuery Ajax Example - Part 2

    Open Post

    PHP AngularJS CRUD with Search and Pagination Example From Scratch

    PHP AngularJS CRUD with Search and Pagination Example From Scratch

    Open Post

    Jquery - input tags plugin example using jquery.tagsinput.js plugin

    Jquery - input tags plugin example using jquery.tagsinput.js plugin

    Open Post