Skip to content

Commit

Permalink
Add HomeController for auth routes
Browse files Browse the repository at this point in the history
  • Loading branch information
deeshrestha committed Jul 29, 2017
1 parent 7da6bd2 commit 6cfa941
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/ZurbFoundationPreset.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ protected static function updateWelcomePage()
*/
protected static function addAuthTemplates()
{
// Add Home controller
copy(__DIR__.'/foundation-stubs/Controllers/HomeController.php', app_path('Http/Controllers/HomeController.php'));

// Add Auth route in 'routes/web.php'
$auth_route_entry = "Auth::routes();\n\nRoute::get('/home', 'HomeController@index')->name('home');\n\n";
file_put_contents('./routes/web.php', $auth_route_entry, FILE_APPEND);
Expand Down
28 changes: 28 additions & 0 deletions src/foundation-stubs/Controllers/HomeController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}

/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('home');
}
}
2 changes: 1 addition & 1 deletion src/foundation-stubs/views/welcome.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
</div>

<div class="foundation_button_test">
<p class="framwork_title">Zurb Foundation 6.4.1 Buttons</p>
<p class="framwork_title">Zurb Foundation 6.4.1</p>
<a class="button primary" href="#">Primary</a>
<a class="button secondary" href="#">Secondary</a>
<a class="button success" href="#">Success</a>
Expand Down

0 comments on commit 6cfa941

Please sign in to comment.