Skip to content

Commit

Permalink
added auth and admin
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardHpa committed Nov 20, 2017
1 parent 0cf854e commit c85eeee
Show file tree
Hide file tree
Showing 24 changed files with 788 additions and 243 deletions.
12 changes: 12 additions & 0 deletions app/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class AdminController extends Controller
{
public function index(){
return view('admin.index');
}
}
28 changes: 28 additions & 0 deletions app/Http/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');
}
}
5 changes: 4 additions & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace App\Providers;

use Illuminate\Support\ServiceProvider;
// Add the line bellow
use Illuminate\Support\Facades\Schema;

class AppServiceProvider extends ServiceProvider
{
Expand All @@ -13,7 +15,8 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
//
//add line bellow
Schema::defaultStringLength(191);
}

/**
Expand Down
30 changes: 30 additions & 0 deletions public/css/admin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
body{
margin-top: 60px;
}
img{
max-width: 100%;
}

.full{
padding: 0
}

.logout{
color: black !important;
}

.sidebar {
position: fixed;
top: 51px;
bottom: 0;
left: 0;
z-index: 1000;
padding: 20px 0;
overflow-x: hidden;
overflow-y: auto;
border-right: 1px solid #eee;
}

.sidebar .nav-link {
border-radius: 0;
}
4 changes: 4 additions & 0 deletions public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ img{

.full{
padding: 0
}

.logout{
color: black !important;
}
70 changes: 25 additions & 45 deletions resources/views/about/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,45 +1,25 @@
<html>
<head>
<title>About Page</title>
<link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap.min.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/style.css') }}">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="/">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ route('blog.index') }}">Blog</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url('about') }}">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url('contact') }}">Contact</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>

<div class="container">
<h1>About Page</h1>
</div>


<script type="text/javascript" src="{{ asset('js/jquery-3.2.1.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/bootstrap.bundle.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/script.js') }}"></script>
</body>
</html>
@extends('layouts.master')

@section('title', ' About Page')
@section('description', 'This is the about Page')

@section('styles')
<style type="text/css">
h1{
color:red;
}
</style>
@endsection

@section('content')
<div class="container">
<h1>This is the about page</h1>
</div>
@endsection

@section('scripts')

@endsection



35 changes: 35 additions & 0 deletions resources/views/admin/index.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@extends('layouts.admin')

@section('title', 'Admin Page')
@section('description', 'This is the admin Page')

@section('styles')

@endsection

@section('content')
<div class="container-fluid">
<div class="row">
<nav class="col-sm-3 col-md-2 d-none d-sm-block bg-light sidebar">
<ul class="nav nav-pills flex-column">
<li class="nav-item">
<a class="nav-link active" href="#">Dashboard <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Blogs</a>
</li>
</ul>
</nav>
<div class="col-sm-9 ml-sm-auto col-md-10 pt-3">
<h1>Admin Dashboard</h1>
</div>
</div>
</div>
@endsection

@section('scripts')

@endsection



69 changes: 69 additions & 0 deletions resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
@extends('layouts.master')

@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Login</div>

<div class="panel-body">
<form class="form-horizontal" method="POST" action="{{ route('login') }}">
{{ csrf_field() }}

<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="col-md-4 control-label">E-Mail Address</label>

<div class="col-md-6">
<input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required autofocus>

@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
</div>

<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password" class="col-md-4 control-label">Password</label>

<div class="col-md-6">
<input id="password" type="password" class="form-control" name="password" required>

@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>

<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<div class="checkbox">
<label>
<input type="checkbox" name="remember" {{ old('remember') ? 'checked' : '' }}> Remember Me
</label>
</div>
</div>
</div>

<div class="form-group">
<div class="col-md-8 col-md-offset-4">
<button type="submit" class="btn btn-primary">
Login
</button>

<a class="btn btn-link" href="{{ route('password.request') }}">
Forgot Your Password?
</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection
47 changes: 47 additions & 0 deletions resources/views/auth/passwords/email.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@extends('layouts.app')

@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Reset Password</div>

<div class="panel-body">
@if (session('status'))
<div class="alert alert-success">
{{ session('status') }}
</div>
@endif

<form class="form-horizontal" method="POST" action="{{ route('password.email') }}">
{{ csrf_field() }}

<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="col-md-4 control-label">E-Mail Address</label>

<div class="col-md-6">
<input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required>

@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
</div>

<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<button type="submit" class="btn btn-primary">
Send Password Reset Link
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection
70 changes: 70 additions & 0 deletions resources/views/auth/passwords/reset.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
@extends('layouts.app')

@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Reset Password</div>

<div class="panel-body">
<form class="form-horizontal" method="POST" action="{{ route('password.request') }}">
{{ csrf_field() }}

<input type="hidden" name="token" value="{{ $token }}">

<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="col-md-4 control-label">E-Mail Address</label>

<div class="col-md-6">
<input id="email" type="email" class="form-control" name="email" value="{{ $email or old('email') }}" required autofocus>

@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
</div>

<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password" class="col-md-4 control-label">Password</label>

<div class="col-md-6">
<input id="password" type="password" class="form-control" name="password" required>

@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>

<div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
<label for="password-confirm" class="col-md-4 control-label">Confirm Password</label>
<div class="col-md-6">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>

@if ($errors->has('password_confirmation'))
<span class="help-block">
<strong>{{ $errors->first('password_confirmation') }}</strong>
</span>
@endif
</div>
</div>

<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<button type="submit" class="btn btn-primary">
Reset Password
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection
Loading

0 comments on commit c85eeee

Please sign in to comment.