How to save an image in a database field?

Good day!

How to save an image in a database field in Laravel 5?
Are interested in a specific code that you want to add in the function controller after the stage of validation, for example in store()?

PS For those who send in the "see Google", I will explain Google mostly shows results that contain examples of saving images in storage.
June 10th 19 at 16:25
3 answers
June 10th 19 at 16:27
It is not advisable to save the image in BD, as your base will grow enormously.
Better to save in database the path to the picture and put it in any directory.
June 10th 19 at 16:29
Do not go into details why. Read the resulting file from tmp folder
$filedata = file_get_contents(path/to/tmp/file/from/post/data);

File::create(["data" => $fileadata]);

The data type of the field data BLOB or derivatives. To this then was more or less to manipulate, throws in a table type of file, end, name, size and other meta-data.
June 10th 19 at 16:31
If I correctly understood the task, then alternatively you can save the image in base64 format.

Find more questions by tags Laravel