Working on multiple files upload
This commit is contained in:
parent
4cca224587
commit
7d11a6fa1c
4 changed files with 23 additions and 30 deletions
|
|
@ -5,6 +5,7 @@ namespace App\Http\Controllers;
|
||||||
use App\Gallery;
|
use App\Gallery;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Auth;
|
use Auth;
|
||||||
|
use App\Tour;
|
||||||
|
|
||||||
class GalleryController extends Controller
|
class GalleryController extends Controller
|
||||||
{
|
{
|
||||||
|
|
@ -24,16 +25,6 @@ class GalleryController extends Controller
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Store a newly created resource in storage.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
|
|
@ -45,7 +36,7 @@ class GalleryController extends Controller
|
||||||
{
|
{
|
||||||
//dd("role:" . Auth::user()->role . " id:" . \Auth::id() . " has_tour:" . Auth::user()->has_tour($tour_id, \Auth::id()));
|
//dd("role:" . Auth::user()->role . " id:" . \Auth::id() . " has_tour:" . Auth::user()->has_tour($tour_id, \Auth::id()));
|
||||||
if(Auth::user()->role=="ADMIN" or Auth::user()->has_tour($tour_id, \Auth::id()) ) {
|
if(Auth::user()->role=="ADMIN" or Auth::user()->has_tour($tour_id, \Auth::id()) ) {
|
||||||
return view('tour/gallery/show');
|
return view('tour/gallery/show')->with("tour_id",$tour_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -63,19 +54,7 @@ class GalleryController extends Controller
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @param \App\Gallery $gallery
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function update(Request $request, $tour_id)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the specified resource from storage.
|
* Remove the specified resource from storage.
|
||||||
*
|
*
|
||||||
* @param \App\Gallery $gallery
|
* @param \App\Gallery $gallery
|
||||||
|
|
@ -85,4 +64,17 @@ class GalleryController extends Controller
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function store(Request $request, Tour $tour) {
|
||||||
|
$request->validate(
|
||||||
|
[
|
||||||
|
'files' => 'required'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
//$filelist = join(', ', $request->files);
|
||||||
|
//dd($filelist);
|
||||||
|
$filelist="";
|
||||||
|
//foreach($request->files as $filename) { $filelist = $filelist + $filename; }
|
||||||
|
dd($request->files);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ server {
|
||||||
error_log /var/log/nginx/error.log;
|
error_log /var/log/nginx/error.log;
|
||||||
access_log /var/log/nginx/access.log;
|
access_log /var/log/nginx/access.log;
|
||||||
root /var/www/public;
|
root /var/www/public;
|
||||||
|
client_max_body_size 0;
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,11 @@
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<h1 style="color:white;">Hochladen</h1>
|
<h1 style="color:white;">Hochladen</h1>
|
||||||
|
<form style="background-color: #fff;" class="text-dark" method="post" action="/tour/gallery/{{$tour_id}}" enctype="multipart/form-data">
|
||||||
<form action="/action_page.php">
|
@csrf
|
||||||
<input type="file" id="myFile" name="filename" multiple>
|
<input type="file" id="myFile" name="files[]" multiple>
|
||||||
<input type="submit">
|
<input type="submit">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,8 @@
|
||||||
Route::get('/img_storage/{category}/{imageName}', 'ImageController@getImage'); // no middleware auth needed, its checked in Controller
|
Route::get('/img_storage/{category}/{imageName}', 'ImageController@getImage'); // no middleware auth needed, its checked in Controller
|
||||||
|
|
||||||
Route::get('/tour/gallery/{gallery_id}', 'GalleryController@show'); // no middleware auth needed, its checked in Controller
|
Route::get('/tour/gallery/{gallery_id}', 'GalleryController@show'); // no middleware auth needed, its checked in Controller
|
||||||
|
Route::post('/tour/gallery/{gallery_id}', 'GalleryController@store');
|
||||||
|
|
||||||
Auth::routes();
|
Auth::routes();
|
||||||
|
|
||||||
/* Cache clearing on remote server */
|
/* Cache clearing on remote server */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue