-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"directory": "vendor/bower_dl" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* text=auto | ||
*.css linguist-vendored | ||
*.less linguist-vendored |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/vendor | ||
/node_modules | ||
/public/storage | ||
Homestead.yaml | ||
Homestead.json | ||
.env | ||
.DS_Store* | ||
._* |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Illuminate\Foundation\Inspiring; | ||
|
||
class Inspire extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'inspire'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Display an inspiring quote'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return mixed | ||
*/ | ||
public function handle() | ||
{ | ||
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace App\Console; | ||
|
||
use Illuminate\Console\Scheduling\Schedule; | ||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | ||
|
||
class Kernel extends ConsoleKernel | ||
{ | ||
/** | ||
* The Artisan commands provided by your application. | ||
* | ||
* @var array | ||
*/ | ||
protected $commands = [ | ||
\App\Console\Commands\Inspire::class, | ||
]; | ||
|
||
/** | ||
* Define the application's command schedule. | ||
* | ||
* @param \Illuminate\Console\Scheduling\Schedule $schedule | ||
* @return void | ||
*/ | ||
protected function schedule(Schedule $schedule) | ||
{ | ||
$schedule->command('inspire') | ||
->hourly(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace App\Events; | ||
|
||
abstract class Event | ||
{ | ||
// | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace App\Exceptions; | ||
|
||
use Exception; | ||
use Illuminate\Database\Eloquent\ModelNotFoundException; | ||
use Symfony\Component\HttpKernel\Exception\HttpException; | ||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | ||
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 = [ | ||
HttpException::class, | ||
ModelNotFoundException::class, | ||
]; | ||
|
||
/** | ||
* Report or log an exception. | ||
* | ||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc. | ||
* | ||
* @param \Exception $e | ||
* @return void | ||
*/ | ||
public function report(Exception $e) | ||
{ | ||
return parent::report($e); | ||
} | ||
|
||
/** | ||
* Render an exception into an HTTP response. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param \Exception $e | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function render($request, Exception $e) | ||
{ | ||
if ($e instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException) | ||
{ | ||
return redirect('/'); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Admin; | ||
|
||
use App\Jobs\PostFormFields; | ||
use App\Http\Requests; | ||
use App\Http\Requests\PostCreateRequest; | ||
use App\Http\Requests\PostUpdateRequest; | ||
use App\Http\Controllers\Controller; | ||
use App\Post; | ||
|
||
class PostController extends Controller | ||
{ | ||
/** | ||
* Display a listing of the posts. | ||
*/ | ||
public function index() | ||
{ | ||
return view('admin.post.index') | ||
->withPosts(Post::all()); | ||
} | ||
|
||
/** | ||
* Show the new post form | ||
*/ | ||
public function create() | ||
{ | ||
$data = $this->dispatch(new PostFormFields()); | ||
|
||
return view('admin.post.create', $data); | ||
} | ||
|
||
/** | ||
* Store a newly created Post | ||
* | ||
* @param PostCreateRequest $request | ||
*/ | ||
public function store(PostCreateRequest $request) | ||
{ | ||
$post = Post::create($request->postFillData()); | ||
$post->syncTags($request->get('tags', [])); | ||
|
||
return redirect() | ||
->route('admin.post.index') | ||
->withSuccess('New Post Successfully Created.'); | ||
} | ||
|
||
/** | ||
* Show the post edit form | ||
* | ||
* @param int $id | ||
* @return Response | ||
*/ | ||
public function edit($id) | ||
{ | ||
$data = $this->dispatch(new PostFormFields($id)); | ||
|
||
return view('admin.post.edit', $data); | ||
} | ||
|
||
/** | ||
* Update the Post | ||
* | ||
* @param PostUpdateRequest $request | ||
* @param int $id | ||
*/ | ||
public function update(PostUpdateRequest $request, $id) | ||
{ | ||
$post = Post::findOrFail($id); | ||
$post->fill($request->postFillData()); | ||
$post->save(); | ||
$post->syncTags($request->get('tags', [])); | ||
|
||
if ($request->action === 'continue') { | ||
return redirect() | ||
->back() | ||
->withSuccess('Post saved.'); | ||
} | ||
|
||
return redirect() | ||
->route('admin.post.index') | ||
->withSuccess('Post saved.'); | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
* | ||
* @param int $id | ||
* @return Response | ||
*/ | ||
public function destroy($id) | ||
{ | ||
$post = Post::findOrFail($id); | ||
$post->tags()->detach(); | ||
$post->delete(); | ||
|
||
return redirect() | ||
->route('admin.post.index') | ||
->withSuccess('Post deleted.'); | ||
} | ||
} |