bla
This commit is contained in:
parent
29e8b82b3f
commit
07a3dd235f
@ -14,6 +14,8 @@ use App\Models\Oeuvre;
|
|||||||
use App\Models\Jeu;
|
use App\Models\Jeu;
|
||||||
use Response;
|
use Response;
|
||||||
use Session;
|
use Session;
|
||||||
|
use Config;
|
||||||
|
use File;
|
||||||
|
|
||||||
|
|
||||||
class ReferentController extends Controller {
|
class ReferentController extends Controller {
|
||||||
@ -166,4 +168,33 @@ class ReferentController extends Controller {
|
|||||||
$ListeOeuvre->jeux()->sync($table);
|
$ListeOeuvre->jeux()->sync($table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getImage($filename) {
|
||||||
|
|
||||||
|
// Append the filename to the path where our images are located
|
||||||
|
$path = Config::get('view.images') . $filename;
|
||||||
|
print($path);
|
||||||
|
|
||||||
|
// Initialize an instance of Symfony's File class.
|
||||||
|
// This is a dependency of Laravel so it is readily available.
|
||||||
|
$file = new Symfony\Component\HttpFoundation\File\File($path);
|
||||||
|
|
||||||
|
// Make a new response out of the contents of the file
|
||||||
|
// Set the response status code to 200 OK
|
||||||
|
$response = Response::make(
|
||||||
|
File::get($path),
|
||||||
|
200
|
||||||
|
);
|
||||||
|
|
||||||
|
// Modify our output's header.
|
||||||
|
// Set the content type to the mime of the file.
|
||||||
|
// In the case of a .jpeg this would be image/jpeg
|
||||||
|
$response->header(
|
||||||
|
'Content-type',
|
||||||
|
$file->getMimeType()
|
||||||
|
);
|
||||||
|
|
||||||
|
// We return our image here.
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ Route::group(['middleware' => 'auth'], function ()
|
|||||||
Route::post('search', 'ReferentController@search');
|
Route::post('search', 'ReferentController@search');
|
||||||
Route::post('addItemsToList', 'ReferentController@addItemsToList');
|
Route::post('addItemsToList', 'ReferentController@addItemsToList');
|
||||||
Route::post('updateAssoGames', 'ReferentController@updateAssoGames');
|
Route::post('updateAssoGames', 'ReferentController@updateAssoGames');
|
||||||
|
Route::get('showPic/{file}', 'ReferentController@getImage');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::group(['middleware' => 'admin'], function ()
|
Route::group(['middleware' => 'admin'], function ()
|
||||||
|
@ -27,6 +27,7 @@ return [
|
|||||||
| directory. However, as usual, you are free to change this value.
|
| directory. However, as usual, you are free to change this value.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
'images' => './../resources/assets/images/',
|
||||||
|
|
||||||
'compiled' => realpath(storage_path().'/framework/views'),
|
'compiled' => realpath(storage_path().'/framework/views'),
|
||||||
|
|
||||||
|
BIN
SRC/resources/assets/images/YOURIMAGE.jpg
Executable file
BIN
SRC/resources/assets/images/YOURIMAGE.jpg
Executable file
Binary file not shown.
After Width: | Height: | Size: 1.1 MiB |
@ -96,9 +96,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="inputEmail3" class="col-sm-2 control-label">Désignation</label>
|
<label for="inputEmail3" class="col-sm-2 control-label">Nom Oeuvre</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select data-placeholder="Choisissez une désignation" id="designation" name="designation[]" class="chosen-select" multiple tabindex="4">
|
<select data-placeholder="Choisissez le nom d'une oeuvre" id="designation" name="designation[]" class="chosen-select" multiple tabindex="4">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
@foreach ($data['designation'] as $val)
|
@foreach ($data['designation'] as $val)
|
||||||
<option value="{{$val->id}}">{{$val->nom}}</option>
|
<option value="{{$val->id}}">{{$val->nom}}</option>
|
||||||
|
Reference in New Issue
Block a user