Adding user-uploaded Images - Step 1 - Storing images in the Database

blah

There is much debate about the best way to handle images in a system. Images related to the look of the site itself are best treated as assets and stored as files in the file system with other assets. Images which are uploaded by users, however, can reasonably be base64 encoded and stored as a [...]

Read More...

>

Adding user-uploaded Images - Step 2 - Rendering base64 encoded images on a view

blah

Once the image has been uploaded to the database pulling that information and displaying it on the screen is simply a matter of understanding base64 encoded data. Base64 encoding data is a way of converting binary data into text data which makes it easier to process in html. This example will present an icon-sized image [...]

Read More...

>

Adding multiple Images for an Entity - Step 1 - Creating a database table form to allow for multiple images to be uploaded.

blah

If an entity (a person or an item) needs to have multiple images for each item then you will need an extra database entity and model to store those images. In the following example, we imagine a situation where each member of the tennis club can upload multiple images of themselves. Firstly, we need a [...]

Read More...

>

Adding multiple Images for an Entity - Step 2 - Uploading the Images and saving them to the database

blah

When the user uploads their various image files and submits the form the store() function of app/controllers/MemberimageController.php will be called. We now need to modify this function to allow it to process the array of files that will be uploaded. Modify the store() function that was generated by the scaffold replacing the code in the [...]

Read More...

>

Adding multiple Images for an Entity - Step 3 - Displaying a collection of Images for an entity in a carousel

blah

Once multiple images have been uploaded for an Entity in the database we need a simple way to display them without completely rebuilding the user interface. A bootstrap carousel is an ideal way to display multiple images. For the purposes of this example, we use the show.blade.php view and adapt it slightly to show the [...]

Read More...

>