This is the view that carries the data, the file and the name but when it reaches the controller it only sends the file
<input type="file" name="link" required="required">
<textarea type="text" rows="50" hidden="hidden" id="textosid" name="cliente" ></textarea>
<button type="submit" id="bot" class="btn btn-primary">Subir Boletín</button>
public function store(Request $request)
{
if($request->hasFile('link','cliente')){
$cliente = $request->file('cliente');
$link = $request->file('link');
$file_name = time().$link->getClientOriginalName();
$link->move(public_path().'/boletines/'.$file_name);
}
$file = new File();
$file->cliente = $cliente;
$file->name = $link->getClientOriginalName();
$file->link = $file_name;
$file->save();
Session::flash('Exito','Boletin Guardado');
return Redirect::to('file/create');
///view('file.create');
}
this is the model
protected $table = 'files'; // Nombre de la tabla que se va a llamar
protected $primaryKey = 'id'; // Clave primaria para identificar el usuario.
protected $fillable = [ 'name','link','cliente'];/// los datos.