Pressroom template verwijderd, website naar root van repo
This commit is contained in:
64
app/Console/Kernel.php
Normal file
64
app/Console/Kernel.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
private $API_URL;
|
||||
|
||||
/**
|
||||
* The Artisan commands provided by your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
//
|
||||
];
|
||||
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
$this->API_URL = env('API_URL', 'http://api.6fm.nl/');
|
||||
|
||||
// Update latest news (3 items)
|
||||
$schedule->call(function() {
|
||||
Storage::disk('local')->put('laatste_nieuws.json', file_get_contents($this->API_URL . 'nieuws/overzicht?pagina=1&aantal=3'));
|
||||
Storage::disk('local')->put('populair_nieuws.json', file_get_contents($this->API_URL . 'nieuws/populair'));
|
||||
})->everyMinute();
|
||||
|
||||
// Update now / later
|
||||
$schedule->call(function() {
|
||||
Storage::disk('local')->put('nu_straks.json', file_get_contents($this->API_URL . 'programma/schema/nustraks'));
|
||||
Storage::disk('local')->put('zojuist.json', file_get_contents($this->API_URL . 'programma/schema/recent'));
|
||||
})->everyMinute();
|
||||
|
||||
// Update latest podcasts (6 items)
|
||||
$schedule->call(function() {
|
||||
Storage::disk('local')->put('laatste_podcasts.json', file_get_contents($this->API_URL . 'podcast/overzicht?pagina=1&aantal=6'));
|
||||
})->everyMinute();
|
||||
|
||||
// Update calendar items
|
||||
$schedule->call(function() {
|
||||
Storage::disk('local')->put('regioagenda.json', file_get_contents($this->API_URL . 'agenda/overzicht'));
|
||||
})->everyMinute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the Closure based commands for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function commands()
|
||||
{
|
||||
require base_path('routes/console.php');
|
||||
}
|
||||
}
|
||||
65
app/Exceptions/Handler.php
Normal file
65
app/Exceptions/Handler.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Auth\AuthenticationException;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
/**
|
||||
* A list of the exception types that should not be reported.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dontReport = [
|
||||
\Illuminate\Auth\AuthenticationException::class,
|
||||
\Illuminate\Auth\Access\AuthorizationException::class,
|
||||
\Symfony\Component\HttpKernel\Exception\HttpException::class,
|
||||
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
|
||||
\Illuminate\Session\TokenMismatchException::class,
|
||||
\Illuminate\Validation\ValidationException::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* Report or log an exception.
|
||||
*
|
||||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
||||
*
|
||||
* @param \Exception $exception
|
||||
* @return void
|
||||
*/
|
||||
public function report(Exception $exception)
|
||||
{
|
||||
parent::report($exception);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Exception $exception
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function render($request, Exception $exception)
|
||||
{
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an authentication exception into an unauthenticated response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Auth\AuthenticationException $exception
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
protected function unauthenticated($request, AuthenticationException $exception)
|
||||
{
|
||||
if ($request->expectsJson()) {
|
||||
return response()->json(['error' => 'Unauthenticated.'], 401);
|
||||
}
|
||||
|
||||
return redirect()->guest(route('login'));
|
||||
}
|
||||
}
|
||||
82
app/Helpers/FormatterHelper.php
Normal file
82
app/Helpers/FormatterHelper.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace App\Helpers;
|
||||
|
||||
setlocale(LC_ALL, 'nl_NL');
|
||||
date_default_timezone_set('Europe/Amsterdam');
|
||||
define('ONE_DAY', 86400);
|
||||
|
||||
class FormatterHelper
|
||||
{
|
||||
private static $weekdays = ["Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag", "Zondag"];
|
||||
private static $months = ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"];
|
||||
|
||||
public static function fullDate(/*\DateTime or \DateTimeImmutable*/ $date, $format)
|
||||
{
|
||||
$weekday = self::$weekdays[$date->format('N') - 1];
|
||||
$month = $date->format('m') - 1;
|
||||
$year = $date->format('Y');
|
||||
return str_replace(['d', 'M', 'm', 'y?', 'y', 'W', 'w'],
|
||||
[$date->format('d'), ($month < 9 ? "0" : "") . ($month + 1), self::$months[$month], $year == date('Y') ? "" : $year, $year, $weekday, strtolower($weekday)],
|
||||
$format);
|
||||
}
|
||||
|
||||
public static function relativeDate($date, $capitalize = true, $fullFormat = 'W d m y?')
|
||||
{
|
||||
$today = strtotime("00:00");
|
||||
$timestamp = $date->getTimestamp();
|
||||
|
||||
if($timestamp == 0)
|
||||
{
|
||||
return $capitalize ? "Nooit" : "nooit";
|
||||
}
|
||||
|
||||
if($timestamp >= $today + 2 * ONE_DAY && $timestamp < $today + 7 * ONE_DAY)
|
||||
{
|
||||
return ($capitalize ? "Aanstaande" : "aanstaande") . " " . strtolower(self::$weekdays[$date->format('N') - 1]);
|
||||
}
|
||||
|
||||
if($timestamp >= $today + ONE_DAY && $timestamp < $today + 2 * ONE_DAY)
|
||||
{
|
||||
return $capitalize ? "Morgen" : "morgen";
|
||||
}
|
||||
|
||||
if($timestamp >= $today && $timestamp < $today + ONE_DAY)
|
||||
{
|
||||
return $capitalize ? "Vandaag" : "vandaag";
|
||||
}
|
||||
|
||||
if($timestamp >= $today - ONE_DAY && $timestamp < $today + ONE_DAY)
|
||||
{
|
||||
return $capitalize ? "Gisteren" : "gisteren";
|
||||
}
|
||||
|
||||
if($timestamp >= $today - 6 * ONE_DAY && $timestamp < $today + ONE_DAY)
|
||||
{
|
||||
return ($capitalize ? "Afgelopen" : "afgelopen") . " " . strtolower(self::$weekdays[$date->format('N') - 1]);
|
||||
}
|
||||
|
||||
return self::fullDate($date, $fullFormat);
|
||||
}
|
||||
|
||||
public static function excerpt($text, $maxLength)
|
||||
{
|
||||
$allowed = '<mark>';
|
||||
if(strlen($text) < $maxLength)
|
||||
{
|
||||
return $text;
|
||||
}
|
||||
|
||||
$matches = [];
|
||||
if(preg_match('/\W/', $text, $matches, PREG_OFFSET_CAPTURE, $maxLength))
|
||||
{
|
||||
return substr(strip_tags($text, $allowed), 0, $matches[0][1]) . "...";
|
||||
}
|
||||
|
||||
return substr(strip_tags($text, $allowed), $maxLength) . "...";
|
||||
}
|
||||
}
|
||||
/*
|
||||
function formatFullDate($date, $includeWeekday) {
|
||||
}
|
||||
*/
|
||||
32
app/Http/Controllers/Auth/ForgotPasswordController.php
Normal file
32
app/Http/Controllers/Auth/ForgotPasswordController.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||
|
||||
class ForgotPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset emails and
|
||||
| includes a trait which assists in sending these notifications from
|
||||
| your application to your users. Feel free to explore this trait.
|
||||
|
|
||||
*/
|
||||
|
||||
use SendsPasswordResetEmails;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
}
|
||||
39
app/Http/Controllers/Auth/LoginController.php
Normal file
39
app/Http/Controllers/Auth/LoginController.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Login Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles authenticating users for the application and
|
||||
| redirecting them to your home screen. The controller uses a trait
|
||||
| to conveniently provide its functionality to your applications.
|
||||
|
|
||||
*/
|
||||
|
||||
use AuthenticatesUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after login.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest')->except('logout');
|
||||
}
|
||||
}
|
||||
71
app/Http/Controllers/Auth/RegisterController.php
Normal file
71
app/Http/Controllers/Auth/RegisterController.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\User;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles the registration of new users as well as their
|
||||
| validation and creation. By default this controller uses a trait to
|
||||
| provide this functionality without requiring any additional code.
|
||||
|
|
||||
*/
|
||||
|
||||
use RegistersUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after registration.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a validator for an incoming registration request.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \Illuminate\Contracts\Validation\Validator
|
||||
*/
|
||||
protected function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => 'required|string|max:255',
|
||||
'email' => 'required|string|email|max:255|unique:users',
|
||||
'password' => 'required|string|min:6|confirmed',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new user instance after a valid registration.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \App\User
|
||||
*/
|
||||
protected function create(array $data)
|
||||
{
|
||||
return User::create([
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => bcrypt($data['password']),
|
||||
]);
|
||||
}
|
||||
}
|
||||
39
app/Http/Controllers/Auth/ResetPasswordController.php
Normal file
39
app/Http/Controllers/Auth/ResetPasswordController.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset requests
|
||||
| and uses a simple trait to include this behavior. You're free to
|
||||
| explore this trait and override any methods you wish to tweak.
|
||||
|
|
||||
*/
|
||||
|
||||
use ResetsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users after resetting their password.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
}
|
||||
29
app/Http/Controllers/CalendarController.php
Normal file
29
app/Http/Controllers/CalendarController.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use \Illuminate\Http\Request;
|
||||
|
||||
class CalendarController extends Controller
|
||||
{
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
parent::registerView($request, 'agenda', $id);
|
||||
$apiResult = $this->API('agenda/item/' . (int)$id);
|
||||
$calendarEvent = new \Model\CalendarEvent($apiResult);
|
||||
|
||||
return view('calendarevent', ['event' => $calendarEvent, 'metadata' => $calendarEvent->metadata]);
|
||||
}
|
||||
|
||||
public function overview(Request $request)
|
||||
{
|
||||
$apiResult = $this->API('agenda/overzicht');
|
||||
$calendar = [];
|
||||
foreach($apiResult as $calendarItem)
|
||||
{
|
||||
$calendar[] = new \Model\CalendarEvent($calendarItem);
|
||||
}
|
||||
|
||||
return view('calendarlist', ['events' => $calendar]);
|
||||
}
|
||||
}
|
||||
117
app/Http/Controllers/Controller.php
Normal file
117
app/Http/Controllers/Controller.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||
|
||||
protected $API_URL;
|
||||
|
||||
private function getDataFromFileAndConvert($file, $path, $class, $maxItems = 0)
|
||||
{
|
||||
$data = json_decode(Storage::disk('local')->get($file));
|
||||
foreach($path as $subobject) { $data = $data->$subobject; }
|
||||
$items = [];
|
||||
foreach($data as $item_data)
|
||||
{
|
||||
$items[] = new $class($item_data);
|
||||
if($maxItems && count($items) == $maxItems) { break; }
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
View::share('apiUrl', $this->API_URL = env('API_URL', 'http://api.6fm.nl/'));
|
||||
View::share('imgBase', env('IMAGE_BASE_URL', '/'));
|
||||
//View::share('onAir', file_get_contents(url('onair')));
|
||||
View::composer('widgets.laatstenieuws', function($view) {
|
||||
$view->with('data', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem'));
|
||||
});
|
||||
View::composer('widgets.populairnieuws', function($view) {
|
||||
$view->with('data', $this->getDataFromFileAndConvert('populair_nieuws.json', [], '\Model\NewsItem'));
|
||||
});
|
||||
View::composer('widgets.nustraks', function($view) {
|
||||
$data = json_decode(Storage::disk('local')->get('nu_straks.json'))->schedule;
|
||||
$programs = [];
|
||||
foreach($data as $item_data)
|
||||
{
|
||||
$programs[] = $program = new \Model\Program($item_data->program);
|
||||
$program->start = new \DateTimeImmutable($item_data->start->date, new \DateTimeZone($item_data->start->timezone));
|
||||
$program->end = new \DateTimeImmutable($item_data->end->date, new \DateTimeZone($item_data->end->timezone));
|
||||
}
|
||||
|
||||
// Need a bit of slack here, otherwise the current program may show up
|
||||
$now = new \DateTimeImmutable('2 minutes ago');
|
||||
$data = json_decode(Storage::disk('local')->get('zojuist.json'))->schedule;
|
||||
$i = 0;
|
||||
foreach(array_reverse($data) as $item_data)
|
||||
{
|
||||
$recent = $program = new \Model\Program($item_data->program);
|
||||
$recent->start = new \DateTimeImmutable($item_data->start->date, new \DateTimeZone($item_data->start->timezone));
|
||||
$recent->end = new \DateTimeImmutable($item_data->end->date, new \DateTimeZone($item_data->end->timezone));
|
||||
if(($recent->end < $now) && (!$recent->nonstop) && (!$recent->rerun)) {
|
||||
$view->with('recent', $recent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$view->with('data', $programs);
|
||||
});
|
||||
View::composer('widgets.laatstepodcasts', function($view) {
|
||||
$view->with('data', $this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast'));
|
||||
});
|
||||
View::composer('widgets.regioagenda', function($view) {
|
||||
$view->with('data', $this->getDataFromFileAndConvert('regioagenda.json', [], '\Model\CalendarEvent'));
|
||||
});
|
||||
View::composer('widgets.menu', function($view) {
|
||||
$view->with('news', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem'))
|
||||
->with('popular', $this->getDataFromFileAndConvert('populair_nieuws.json', [], '\Model\NewsItem', 3))
|
||||
->with('podcasts', $this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast'));
|
||||
});
|
||||
}
|
||||
|
||||
protected function registerView(Request $request, $type, $id)
|
||||
{
|
||||
if(config('app.env') == 'local') {
|
||||
return;
|
||||
}
|
||||
|
||||
app('db')->insert('INSERT INTO `pagestats`(`type`, `item_id`, `visitor_ip`, `session`, `referer`) VALUES(:type, :id, :ip, :session, :referer)', [
|
||||
'type' => $type,
|
||||
'id' => $id,
|
||||
'ip' => $request->server('REMOTE_ADDR'),
|
||||
'session' => md5(Session::getId()),
|
||||
'referer' => $request->server('HTTP_REFERRER')
|
||||
]);
|
||||
}
|
||||
|
||||
protected function API($url)
|
||||
{
|
||||
return json_decode(file_get_contents($this->API_URL . $url));
|
||||
}
|
||||
|
||||
protected static function JsonToDateTime($obj)
|
||||
{
|
||||
return new \DateTime($obj->date, new \DateTimeZone($obj->timezone));
|
||||
}
|
||||
|
||||
public function __call($method, $arguments) {
|
||||
if(substr($method, 0, 5) == 'view_') {
|
||||
$view = substr($method, 5);
|
||||
if(view()->exists($view)) { return view($view); }
|
||||
}
|
||||
return abort(404);
|
||||
}
|
||||
}
|
||||
37
app/Http/Controllers/HomeController.php
Normal file
37
app/Http/Controllers/HomeController.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use \Model\NewsItem;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
public function show()
|
||||
{
|
||||
$apiResult = $this->API('nieuws/overzicht?aantal=12');
|
||||
$news = [];
|
||||
foreach($apiResult->news as $newsItem)
|
||||
{
|
||||
$news[] = new \Model\NewsItem($newsItem);
|
||||
}
|
||||
|
||||
$apiResult = $this->API('programma/schema/nustraks');
|
||||
$comingUp = [];
|
||||
foreach($apiResult->schedule as $program)
|
||||
{
|
||||
$comingUp[] = [
|
||||
'start' => self::JsonToDateTime($program->start),
|
||||
'end' => self::JsonToDateTime($program->end),
|
||||
'program' => new \Model\Program($program->program)
|
||||
];
|
||||
}
|
||||
|
||||
$apiResult = $this->API('podcast/overzicht?aantal=20');
|
||||
$podcasts = [];
|
||||
foreach($apiResult->podcasts as $podcast) {
|
||||
$podcasts[] = new \Model\Podcast($podcast);
|
||||
}
|
||||
|
||||
return view('home', ['news' => $news, 'podcasts' => $podcasts, 'comingUp' => $comingUp]);
|
||||
}
|
||||
}
|
||||
16
app/Http/Controllers/KerkdienstController.php
Normal file
16
app/Http/Controllers/KerkdienstController.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use \Model\NewsItem;
|
||||
|
||||
class KerkdienstController extends Controller
|
||||
{
|
||||
public function main(Request $request)
|
||||
{
|
||||
parent::registerView($request, 'kerkdienst', 0);
|
||||
$apiResult = $this->API('kerkdienst');
|
||||
return view('kerkdienst', ['kerkdienst' => new \Model\Kerkdienst($apiResult)]);
|
||||
}
|
||||
}
|
||||
93
app/Http/Controllers/NewsController.php
Normal file
93
app/Http/Controllers/NewsController.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use \Model\NewsItem;
|
||||
|
||||
class NewsController extends Controller
|
||||
{
|
||||
private static function TimestampToDateTime($timestamp) {
|
||||
$result = new \DateTime;
|
||||
$result->setTimestamp($timestamp);
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
parent::registerView($request, 'nieuws', $id);
|
||||
$apiResult = $this->API('nieuws/bericht/' . $id);
|
||||
$newsItem = new \Model\NewsItem($apiResult->news);
|
||||
|
||||
switch($apiResult->version) {
|
||||
case 1:
|
||||
return view('newsitem', ['news' => $newsItem, 'metadata' => $newsItem->metadata]);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$source = $apiResult->source;
|
||||
$newsItem->published = self::TimestampToDateTime($source->created);
|
||||
$newsItem->edited = self::TimestampToDateTime($source->updated);
|
||||
$newsItem->author = $source->author;
|
||||
$newsItem->images = null; // Images will be embedded
|
||||
$newsItem->video = null; // Videos will be embedded
|
||||
$newsItem->content = $source->blocks;
|
||||
return view('newsitem', ['news' => $newsItem, 'metadata' => $newsItem->metadata]);
|
||||
}
|
||||
}
|
||||
|
||||
public function overview(Request $request)
|
||||
{
|
||||
return $this->listNews($request, 'overzicht');
|
||||
}
|
||||
|
||||
public function regionlist(Request $request, $region)
|
||||
{
|
||||
return $this->listNews($request, 'regio/' . $region, ucfirst($region));
|
||||
}
|
||||
|
||||
public function themelist(Request $request, $theme)
|
||||
{
|
||||
return $this->listNews($request, 'thema/' . $theme, ucfirst($theme));
|
||||
}
|
||||
|
||||
public function search(Request $request, $query)
|
||||
{
|
||||
return $this->listNews($request, 'zoeken/' . $query, 'Zoekresultaat')->with('query', urldecode($query));
|
||||
}
|
||||
|
||||
private function listNews(Request $request, $url, $title = null)
|
||||
{
|
||||
$page = (int)$request->get('pagina', 1);
|
||||
$apiResult = $this->API('nieuws/' . $url . '?pagina=' . (int)max(1, $page));
|
||||
$news = [];
|
||||
foreach($apiResult->news as $newsItem)
|
||||
{
|
||||
$news[] = new \Model\NewsItem($newsItem);
|
||||
}
|
||||
|
||||
return view($request->ajax() ? 'partial/newslist_small' : ($title == null ? 'home' : 'newslist'), ['title' => $title, 'news' => $news, 'searchURL' => 'nieuws/zoeken']);
|
||||
}
|
||||
|
||||
public function popular()
|
||||
{
|
||||
$apiResult = $this->API('nieuws/populair');
|
||||
$news = [];
|
||||
foreach($apiResult as $newsItem)
|
||||
{
|
||||
$news[] = new \Model\NewsItem($newsItem);
|
||||
}
|
||||
|
||||
return view('popularnews', ['news' => $news]);
|
||||
}
|
||||
|
||||
public function regionieuws()
|
||||
{
|
||||
return view('listen', [
|
||||
'source' => $this->API_URL . 'nieuws/regionieuws',
|
||||
'title' => 'Regionieuws',
|
||||
'content' => 'het laatste nieuws uit de regio',
|
||||
'isStream' => false,
|
||||
'canDownload' => true ]);
|
||||
}
|
||||
}
|
||||
109
app/Http/Controllers/RadioController.php
Normal file
109
app/Http/Controllers/RadioController.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use \Illuminate\Http\Request;
|
||||
use \Model\Programma;
|
||||
|
||||
class RadioController extends Controller
|
||||
{
|
||||
public function schedule(Request $request, $shiftWeeks = 0)
|
||||
{
|
||||
$apiResult = $this->API('programma/schema/week/' . (int)$shiftWeeks);
|
||||
$start = self::JsonToDateTime($apiResult->startdate);
|
||||
$end = self::JsonToDateTime($apiResult->enddate);
|
||||
|
||||
$schedule = [];
|
||||
foreach($apiResult->schedule as $program)
|
||||
{
|
||||
$schedule[] = [
|
||||
'starttime' => self::JsonToDateTime($program->start),
|
||||
'endtime' => self::JsonToDateTime($program->end),
|
||||
'shift' => (int)$shiftWeeks,
|
||||
'program' => new \Model\Program($program->program)
|
||||
];
|
||||
}
|
||||
|
||||
return view($request->ajax() ? 'radioscheduleweek' : 'radioschedule', ['start' => $start, 'end' => $end, 'schedule' => $schedule, 'shift' => $shiftWeeks]);
|
||||
}
|
||||
|
||||
public function onair()
|
||||
{
|
||||
$data = $this->API('programma/schema/onair');
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
public function program($id)
|
||||
{
|
||||
$apiResult = $this->API('programma/details/' . (int)$id);
|
||||
return view('radioprogram', ['program' => new \Model\Program($apiResult)]);
|
||||
}
|
||||
|
||||
public function podcast(Request $request, $id)
|
||||
{
|
||||
parent::registerView($request, 'podcast', $id);
|
||||
$apiResult = $this->API('podcast/details/' . (int)$id);
|
||||
$podcast = new \Model\Podcast($apiResult);
|
||||
|
||||
$related = [];
|
||||
if($podcast->program != null)
|
||||
{
|
||||
$apiRelated = $this->API("podcast/programma/{$podcast->program->id}?date={$podcast->created->format('Y-m-d')}");
|
||||
foreach($apiRelated->podcasts as $relatedItem)
|
||||
{
|
||||
$related[] = new \Model\Podcast($relatedItem);
|
||||
}
|
||||
}
|
||||
|
||||
return view('podcastitem', ['podcast' => $podcast, 'metadata' => $podcast->metadata, 'related' => $related, 'searchURL' => 'gemist/zoeken']);
|
||||
}
|
||||
|
||||
public function podcasts(Request $request, $programma = null)
|
||||
{
|
||||
$action = 'overzicht';
|
||||
$viewData = [];
|
||||
if((int)$programma > 0) {
|
||||
$action = 'programma/' . (int)$programma;
|
||||
$viewData['program'] = new \Model\Program($this->API('programma/details/' . (int)$programma));
|
||||
}
|
||||
|
||||
return $this->getPodcastList($request, $action, $viewData);
|
||||
}
|
||||
|
||||
public function searchpodcast(Request $request, $query)
|
||||
{
|
||||
return $this->getPodcastList($request, 'zoeken/' . $query)->with('query', urldecode($query));
|
||||
}
|
||||
|
||||
public function terugluisteren(Request $request)
|
||||
{
|
||||
$programs = [];
|
||||
$now = new \DateTimeImmutable('2 minutes ago');
|
||||
$apiResult = $this->API('programma/schema/recent');
|
||||
foreach($apiResult->schedule as $item) {
|
||||
if(!$item->program->nonstop && !$item->program->rerun) {
|
||||
$item->start = self::JsonToDateTime($item->start);
|
||||
$item->end = self::JsonToDateTime($item->end);
|
||||
$item->current = $item->end >= $now;
|
||||
$item->program = new \Model\Program($item->program);
|
||||
$programs[] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
return view('programlist', ['programs' => array_reverse($programs)]);
|
||||
}
|
||||
|
||||
private function getPodcastList(Request $request, $action, $viewData = [])
|
||||
{
|
||||
$page = (int)$request->get('pagina', 1);
|
||||
$apiResult = $this->API('podcast/' . $action . '?pagina=' . (int)max(1, $page) . '&aantal=12');
|
||||
$podcasts = [];
|
||||
foreach($apiResult->podcasts as $podcast)
|
||||
{
|
||||
$podcasts[] = new \Model\Podcast($podcast);
|
||||
}
|
||||
|
||||
return view($request->ajax() ? 'partial.podcastitems' : 'podcastlist', array_merge($viewData, ['podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken']));
|
||||
}
|
||||
|
||||
}
|
||||
79
app/Http/Controllers/StreamController.php
Normal file
79
app/Http/Controllers/StreamController.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use \Illuminate\Http\Request;
|
||||
use \Model\Podcast;
|
||||
|
||||
class StreamController extends Controller
|
||||
{
|
||||
private static $STREAM_URL = 'https://stream.nhgooi.nl:8001/';
|
||||
|
||||
public function liveradio()
|
||||
{
|
||||
return view('listen', [
|
||||
'source' => self::$STREAM_URL . 'mp3live',
|
||||
'title' => 'Luister live',
|
||||
'content' => 'de live-uitzending van NH Gooi.',
|
||||
'isStream' => true ]);
|
||||
}
|
||||
|
||||
public function livetv()
|
||||
{
|
||||
return view('watch');
|
||||
}
|
||||
|
||||
public function podcast(Request $request, $id)
|
||||
{
|
||||
$apiResult = $this->API('podcast/details/' . (int)$id);
|
||||
$podcast = new \Model\Podcast($apiResult);
|
||||
if($podcast->auth != $request->get('auth')) {
|
||||
return abort(403);
|
||||
}
|
||||
|
||||
return view('listen', [
|
||||
'source' => $this->API_URL . 'podcast/download' . $apiResult->url . '?auth=' . $podcast->auth,
|
||||
'title' => $podcast->title,
|
||||
'content' => $podcast->title,
|
||||
'isStream' => false,
|
||||
'canDownload' => true ]);
|
||||
}
|
||||
|
||||
public function program(Request $request, $year, $month, $day, $hour, $duration, $offset = 0) {
|
||||
$date = (new \DateTimeImmutable())->setDate($year, $month, $day)->setTime($hour, 0, 0);
|
||||
$current = $date->add(\DateInterval::createFromDateString($offset . ' hours'));
|
||||
|
||||
$hours = [];
|
||||
for($i = 0; $i < $duration; $i++) {
|
||||
$other = $date->add(\DateInterval::createFromDateString($i . ' hours'));
|
||||
$url = '/luister/programma/' . $date->format('Y/m/d/H') . '/' . $duration . '/' . $i;
|
||||
$hours[$offset == $i ? '#' : $url] = 'Uur ' . ($i + 1) . ' (' . $other->format('H') . ':00)';
|
||||
}
|
||||
|
||||
return view('listen', [
|
||||
'source' => $this->API_URL . 'programma/download/' . $current->format('Y/m/d/H') . '/1',
|
||||
'tabs' => $hours,
|
||||
'title' => 'Uitzending terugluisteren',
|
||||
'content' => 'de uitzending van ' . $current->format('d-m-Y, H') . ':00 uur',
|
||||
'isStream' => false,
|
||||
'canDownload' => false ]);
|
||||
}
|
||||
|
||||
public function gemeenteraad(Request $request) {
|
||||
return view('listen', [
|
||||
'source' => self::$STREAM_URL . 'gemhuizen',
|
||||
'title' => 'Gemeenteraad Huizen',
|
||||
'content' => 'de openbare vergadering van de gemeenteraad Huizen',
|
||||
'isStream' => true,
|
||||
'canDownload' => false ]);
|
||||
}
|
||||
|
||||
public function kerkdienst(Request $request) {
|
||||
return view('listen', [
|
||||
'source' => $this->API_URL . 'kerkdienst/download',
|
||||
'title' => 'Kerkdienst gemist',
|
||||
'content' => 'de kerkdienst van afgelopen zondag',
|
||||
'isStream' => false,
|
||||
'canDownload' => true ]);
|
||||
}
|
||||
}
|
||||
60
app/Http/Kernel.php
Normal file
60
app/Http/Kernel.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
*
|
||||
* These middleware are run during every request to your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
||||
\App\Http\Middleware\TrimStrings::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware groups.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middlewareGroups = [
|
||||
'web' => [
|
||||
\App\Http\Middleware\EncryptCookies::class,
|
||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
// \Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
|
||||
'api' => [
|
||||
'throttle:60,1',
|
||||
'bindings',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware.
|
||||
*
|
||||
* These middleware may be assigned to groups or used individually.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $routeMiddleware = [
|
||||
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
|
||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
];
|
||||
}
|
||||
17
app/Http/Middleware/EncryptCookies.php
Normal file
17
app/Http/Middleware/EncryptCookies.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies as BaseEncrypter;
|
||||
|
||||
class EncryptCookies extends BaseEncrypter
|
||||
{
|
||||
/**
|
||||
* The names of the cookies that should not be encrypted.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
||||
26
app/Http/Middleware/RedirectIfAuthenticated.php
Normal file
26
app/Http/Middleware/RedirectIfAuthenticated.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class RedirectIfAuthenticated
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @param string|null $guard
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next, $guard = null)
|
||||
{
|
||||
if (Auth::guard($guard)->check()) {
|
||||
return redirect('/home');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
18
app/Http/Middleware/TrimStrings.php
Normal file
18
app/Http/Middleware/TrimStrings.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\TrimStrings as BaseTrimmer;
|
||||
|
||||
class TrimStrings extends BaseTrimmer
|
||||
{
|
||||
/**
|
||||
* The names of the attributes that should not be trimmed.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
}
|
||||
17
app/Http/Middleware/VerifyCsrfToken.php
Normal file
17
app/Http/Middleware/VerifyCsrfToken.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
||||
|
||||
class VerifyCsrfToken extends BaseVerifier
|
||||
{
|
||||
/**
|
||||
* The URIs that should be excluded from CSRF verification.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
||||
28
app/Providers/AppServiceProvider.php
Normal file
28
app/Providers/AppServiceProvider.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
30
app/Providers/AuthServiceProvider.php
Normal file
30
app/Providers/AuthServiceProvider.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The policy mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $policies = [
|
||||
'App\Model' => 'App\Policies\ModelPolicy',
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any authentication / authorization services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->registerPolicies();
|
||||
|
||||
//
|
||||
}
|
||||
}
|
||||
21
app/Providers/BroadcastServiceProvider.php
Normal file
21
app/Providers/BroadcastServiceProvider.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
|
||||
class BroadcastServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
Broadcast::routes();
|
||||
|
||||
require base_path('routes/channels.php');
|
||||
}
|
||||
}
|
||||
32
app/Providers/EventServiceProvider.php
Normal file
32
app/Providers/EventServiceProvider.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event listener mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $listen = [
|
||||
'App\Events\Event' => [
|
||||
'App\Listeners\EventListener',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any events for your application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
//
|
||||
}
|
||||
}
|
||||
73
app/Providers/RouteServiceProvider.php
Normal file
73
app/Providers/RouteServiceProvider.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* This namespace is applied to your controller routes.
|
||||
*
|
||||
* In addition, it is set as the URL generator's root namespace.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $namespace = 'App\Http\Controllers';
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map()
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
|
||||
$this->mapWebRoutes();
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapWebRoutes()
|
||||
{
|
||||
Route::middleware('web')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/web.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapApiRoutes()
|
||||
{
|
||||
Route::prefix('api')
|
||||
->middleware('api')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api.php'));
|
||||
}
|
||||
}
|
||||
29
app/User.php
Normal file
29
app/User.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name', 'email', 'password',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for arrays.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password', 'remember_token',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user