Merhaba dosya upload yaptım yalnız şimdi de ismi eklerken hata alıyorum. veritabanı tablo adım "nots"
controller
<?php
namespace App\Http\Controllers;
use App\Not;
use App\Http\Controllers\Controller;
namespace App\Http\Controllers;
use Request;
class UploadController extends Controller
{
//
public function storeFiles(Request $request)
{
$input = \Request::all();
// Request the file input named 'attachments'
$files = Request::file('attachments');
//If the array is not empty
if ($files[0] != '') {
foreach($files as $file) {
// Set the destination path
$destinationPath = 'uploads';
// Get the orginal filname or create the filename of your choice
// $f = $file->getClientOriginalName();
// Copy the file in our upload folder
$temp = explode(".", $file->getClientOriginalName());
$m=md5($temp[0].round(microtime(true)));
$filename = $m. '.' . end($temp);
$file->move($destinationPath, $filename);
//DB::enableQueryLog();
$ders = new Not(array(
'userid' => $request->post('userid'),
'not' => $request->post('not1'),
'mail' => $request->post('mail'),
'dosyadi'=>$filename,
'grupno'=>'1'
));
// dd(DB::getQueryLog());
$ders->save();
}
}
// Retrun a redirection or a view
return redirect('/');
}
}
model Not
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Not extends Model
{
public $fillable = ['id','userid','not','mail','grupno','dosyaadi'];
public function notu() {//ürüne ait Model
// return $this->belongsTo('App\Bolum', 'bolumid', 'id');
return $this->belongsTo('App\User', 'userid');
}
}
hata
FatalErrorException in UploadController.php line 50:
Class 'App\Http\Controllers\Not' not found