32 lines
579 B
PHP
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');
|
||
|
}
|
||
|
}
|