photo/app/Http/Controllers/PhotoController.php
2016-06-22 16:53:48 +10:00

32 lines
579 B
PHP

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Response;
use App\Http\Requests;
use App\Model\Photo;
class PhotoController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
public function info($id)
{
return view('photo.view', ['photo'=> Photo::findOrFail($id)]);
}
public function thumbnail($id)
{
return (new Response(Photo::findOrFail($id)->thumbnail()))->header('Content-Type','image/jpg');
}
}