2021-07-26 22:39:11 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use App\Models\Meme;
|
2021-08-06 17:01:16 -04:00
|
|
|
use Artesaos\SEOTools\Facades\SEOTools;
|
2021-07-26 22:39:11 -04:00
|
|
|
|
|
|
|
class ApiController extends Controller
|
|
|
|
{
|
|
|
|
public function documentation()
|
|
|
|
{
|
2021-08-06 17:01:16 -04:00
|
|
|
SEOTools::setTitle('API');
|
2021-07-26 22:39:11 -04:00
|
|
|
$data = [
|
2021-08-06 16:06:07 -04:00
|
|
|
'memes_example' => json_encode(Meme::limit(1)->get(), JSON_PRETTY_PRINT),
|
2021-07-26 22:39:11 -04:00
|
|
|
'memes_endpoint' => url('api/memes'),
|
|
|
|
];
|
|
|
|
return view('api', ['data' => $data]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function memes()
|
|
|
|
{
|
|
|
|
$memes = Meme::get();
|
|
|
|
return $memes;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|