tethys/app/Http/Controllers/Frontend/PagesController.php

38 lines
900 B
PHP
Raw Normal View History

2018-08-06 12:30:51 +00:00
<?php
2018-09-06 15:58:54 +00:00
namespace App\Http\Controllers\Frontend;
2015-07-19 06:49:24 +00:00
2018-09-06 15:58:54 +00:00
use App\Http\Controllers\Controller;
2018-08-06 12:30:51 +00:00
use App\Dataset;
2015-07-19 06:49:24 +00:00
use Illuminate\Http\Request;
2018-08-06 12:30:51 +00:00
use Illuminate\View\View;
class PagesController extends Controller
{
public function __construct()
{
// $this->middleware('auth');
}
2018-09-06 15:58:54 +00:00
public function datasets() : View
2018-08-06 12:30:51 +00:00
{
// $books = Book::with('category', 'shelf')->orderByTitle()->get();
$documents = Dataset::orderByType()->get();
2018-09-06 15:58:54 +00:00
return view('frontend.dataset.dataset', compact('documents'));
2018-08-06 12:30:51 +00:00
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id): View
{
$document = Dataset::findOrFail($id);
$document->load('titles');
$document->load('abstracts');
2018-09-06 15:58:54 +00:00
return view('frontend.dataset.show', compact('document'));
2018-08-06 12:30:51 +00:00
}
2015-07-19 06:49:24 +00:00
}