1. Go to this page and download the library: Download levoolabs/imageable 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/ */
levoolabs / imageable example snippets
$topic = Topic::where('name', 'Awsome topic')->first();
echo $topic->image->s; // Small image url
echo $topic->image->m; // Medium image url
echo $topic->image->l; // Large image url
echo $topic->image->o; // Original image url
foreach ($product->secondary_images as $image) {
echo $image->s;
}
if ($topic->has_image) {
//
}
public function uploadImageAjax(Request $request, Topic $topic)
{
if ($request->ajax()) {
$image = $topic->store_image($request->file('file'));
return response()->json(['ok' => $image->id], 200);
}
abort(404);
}