Property Insert Database Part 1
Empezando por crear la ruta en la forma de captura en resources/views/backend/property/add_property.blade.php
...
<form method="POST" action="{{ route('store.property') }}" id="myForm" enctype="multipart/form-data">
@csrf
...
Definimos la ruta en routes/web.php
Route::post('/store/property', 'StoreProperty')->name('store.property');
Empezamos a crear el metodo StoreProperty() en app/Http/Controllers/Backend/PropertyController.php
...
use Intervention\Image\Facades\Image;
...
// Store Property
public function StoreProperty(Request $request){
$image = $request->file('property_thambnail');
// crear un unique id para la imagen
$name_gen = hexdec(uniqid()).'.'.$image->getClientOriginalExtension();
Image::make($image)->resize(370,250)->save('upload/property/thambnail/'.$name_gen);
$save_url = 'upload/property/thambnail/'.$name_gen;
}
Listo!