Skip to content

Commit

Permalink
update to laravel 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mbpcoder committed Feb 8, 2016
1 parent 3ecdcf4 commit 929b0be
Show file tree
Hide file tree
Showing 86 changed files with 1,898 additions and 1,769 deletions.
13 changes: 8 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
APP_ENV=local
APP_DEBUG=true
APP_URL=http://blog.dev
APP_KEY=SomeRandomString

DB_HOST=localhost
DB_DATABASE=blog
DB_USERNAME=root
DB_PASSWORD=1234
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

REDIS_HOST=localhost
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_ENCRYPTION=null
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/vendor
/node_modules
Homestead.yaml
Homestead.json
.env
39 changes: 16 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
Laravel Blog for developer
============
## Laravel PHP Framework

A Laravel 5.1 blog
[![Build Status](https://travis-ci.org/laravel/framework.svg)](https://travis-ci.org/laravel/framework)
[![Total Downloads](https://poser.pugx.org/laravel/framework/d/total.svg)](https://packagist.org/packages/laravel/framework)
[![Latest Stable Version](https://poser.pugx.org/laravel/framework/v/stable.svg)](https://packagist.org/packages/laravel/framework)
[![Latest Unstable Version](https://poser.pugx.org/laravel/framework/v/unstable.svg)](https://packagist.org/packages/laravel/framework)
[![License](https://poser.pugx.org/laravel/framework/license.svg)](https://packagist.org/packages/laravel/framework)

## Features
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, queueing, and caching.

* alias, published, multi category for posts
* posts pagination
* alias, published and order for categories
* Bundled migration for building the database schema
* powerful admin interface
* newsletters after creating posts
*
Laravel is accessible, yet powerful, providing powerful tools needed for large, robust applications. A superb inversion of control container, expressive migration system, and tightly integrated unit testing support give you the tools you need to build any application with which you are tasked.

## Official Documentation

# init
create .env config file from .env.example and change default values.
run:
Documentation for the framework can be found on the [Laravel website](http://laravel.com/docs).

composer update
php artisan migrate
php artisan db:seed
## Contributing

Some Screenshot
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](http://laravel.com/docs/contributions).

![alt tag](https://cloud.githubusercontent.com/assets/3877538/12076259/fb221706-b1b8-11e5-992f-56b42f51b361.PNG)
## Security Vulnerabilities

![alt tag](https://cloud.githubusercontent.com/assets/3877538/12076260/01a0ee0e-b1b9-11e5-8e4b-0b50d675cfe5.PNG)
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed.

![alt tag](https://cloud.githubusercontent.com/assets/3877538/12076261/058278e4-b1b9-11e5-868c-9f06b311a7aa.PNG)

![alt tag](https://cloud.githubusercontent.com/assets/3877538/12076262/0a0c0cd6-b1b9-11e5-87a4-efa71c93cba6.PNG)
### License

The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)
10 changes: 6 additions & 4 deletions app/Console/Commands/Inspire.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?php namespace Blog\Console\Commands;
<?php

namespace Blog\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Foundation\Inspiring;

class Inspire extends Command
{
/**
* The console command name.
* The name and signature of the console command.
*
* @var string
*/
protected $name = 'inspire';
protected $signature = 'inspire';

/**
* The console command description.
Expand All @@ -26,6 +28,6 @@ class Inspire extends Command
*/
public function handle()
{
$this->comment(PHP_EOL . Inspiring::quote() . PHP_EOL);
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
}
}
10 changes: 6 additions & 4 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Blog\Console;
<?php

namespace Blog\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
Expand All @@ -11,18 +13,18 @@ class Kernel extends ConsoleKernel
* @var array
*/
protected $commands = [
'Blog\Console\Commands\Inspire',
Commands\Inspire::class,
];

/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('inspire')
->hourly();
->hourly();
}
}
4 changes: 3 additions & 1 deletion app/Events/Event.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Blog\Events;
<?php

namespace Blog\Events;

abstract class Event
{
Expand Down
20 changes: 15 additions & 5 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<?php namespace Blog\Exceptions;
<?php

namespace Blog\Exceptions;

use Exception;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
Expand All @@ -11,15 +18,18 @@ class Handler extends ExceptionHandler
* @var array
*/
protected $dontReport = [
'Symfony\Component\HttpKernel\Exception\HttpException'
AuthorizationException::class,
HttpException::class,
ModelNotFoundException::class,
ValidationException::class,
];

/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
Expand All @@ -30,8 +40,8 @@ public function report(Exception $e)
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
Expand Down
82 changes: 82 additions & 0 deletions app/Http/Controllers/Admin/Auth/AuthController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?php

namespace Blog\Http\Controllers\Admin\Auth;

use Blog\User;
use Validator;
use Blog\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;

class AuthController extends Controller
{
/*
|--------------------------------------------------------------------------
| Registration & Login Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users, as well as the
| authentication of existing users. By default, this controller uses
| a simple trait to add these behaviors. Why don't you explore it?
|
*/

use AuthenticatesAndRegistersUsers, ThrottlesLogins;

/**
* Where to redirect users after login / registration.
*
* @var string
*/
protected $redirectTo = '/admin';
protected $redirectAfterLogout = '/admin/login';

/**
* Create a new authentication controller instance.
*
*/
public function __construct()
{
$this->middleware('guest', ['except' => 'logout']);
}

/**
* Show the application login form.
*
* @return \Illuminate\Http\Response
*/
public function showLoginForm()
{
return view('admin.auth.login');
}

/**
* 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|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|confirmed|min:6',
]);
}

/**
* 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']),
]);
}
}
36 changes: 36 additions & 0 deletions app/Http/Controllers/Admin/Auth/PasswordController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php namespace Blog\Http\Controllers\Admin\Auth;

use Blog\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;

class PasswordController 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;

protected $resetView = 'admin.auth.passwords.reset';

/**
* Create a new password controller instance.
*
*/
public function __construct()
{
$this->middleware('guest');
}

public function showLinkRequestForm()
{
return view('admin.auth.passwords.email');
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/CategoriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function index()
public function grid(Request $request)
{
if ($request->ajax() && $request->exists('req')) {
$req = json_decode(\Input::get('req'));
$req = json_decode($request->get('req'));
$perPage = $req->page->perPage;
$from = $perPage * (($req->page->currentPage) - 1);

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/CommentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function index()
public function grid(Request $request)
{
if ($request->ajax() && $request->exists('req')) {
$req = json_decode(\Input::get('req'));
$req = json_decode($request->get('req'));
$perPage = $req->page->perPage;
$from = $perPage * (($req->page->currentPage) - 1);

Expand Down
12 changes: 7 additions & 5 deletions app/Http/Controllers/Admin/NewsletterMembersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Blog\Http\Controllers\Controller;
use Blog\NewsletterMember;
use Illuminate\Http\Request;
use Input as Input;
use Redirect as Redirect;
use Validator as Validator;
Expand All @@ -22,10 +23,10 @@ public function index()
return view('admin.newsletter_members.index');
}

public function grid()
public function grid(Request $request)
{
if (Input::ajax() && Input::exists('req')) {
$req = json_decode(Input::get('req'));
if ($request->ajax() && $request->exists('req')) {
$req = json_decode($request->get('req'));
$perPage = $req->page->perPage;
$from = $perPage * (($req->page->currentPage) - 1);
$query = NewsletterMember::distinct();
Expand Down Expand Up @@ -111,11 +112,12 @@ public function create()
/**
* Store a newly created newslettermembers in storage.
*
* @param Request $request
* @return Response
*/
public function store()
public function store(Request $request)
{
$data = Input::get('emails');
$data = $request->get('emails');
$data = str_replace(array("\n", "\r", ','), ' ', $data);
$emails = explode(' ', $data);
$emails = array_filter($emails);
Expand Down
Loading

0 comments on commit 929b0be

Please sign in to comment.