Beispiel #1
0
 /**
  * Show the application dashboard.
  *
  * @return Response
  */
 public function index()
 {
     $messages = MessageOfTheDay::all();
     $latest_users = User::latest()->limit(3)->get();
     $feed = Messages::all();
     $threads = ForumThreads::latest()->limit(3)->get();
     return view('home', compact('messages', 'latest_users', 'feed'));
 }
Beispiel #2
0
 /**
  * create event form 
  * @return void
  */
 public function createProfileEvent()
 {
     /**
      * select the authorized user
      */
     $profile = User::where('name', Auth::user()->name)->limit(1)->get();
     /**
      * select all games
      */
     $games = Games::all();
     /**
      * return the view
      */
     return view('pages.create_event', compact('profile', 'games'));
 }
Beispiel #3
0
<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
    return view('welcome');
});
if (\Blooddivision\User::count() > 0) {
    Route::get('/members', 'PageController@getMembersPage');
}
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web']], function () {
    //
});
Beispiel #4
0
 /**
  *	get all the registered crew members
  *
  *	@param Blooddivision\User
  *	@return void
  */
 public function getMembersPage()
 {
     $all_members = User::all();
     return view('pages.members')->with('all_members', $all_members);
 }
Beispiel #5
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
 }