Skip to content

Instantly share code, notes, and snippets.

View Mombuyish's full-sized avatar
Never stop progressing.

Yish Mombuyish

Never stop progressing.
View GitHub Profile
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
*
<?php
class GetLimitTimesException extends \Exception
{
//
}
<?php
namespace Tests\Feature\Analysis;
use App\Post;
use Illuminate\Database\Connection;
use Illuminate\Database\DatabaseManager;
use Illuminate\Database\Eloquent\Collection;
use Tests\TestCase;
<?php
class CountByCategoriesAndPublished extends Controller
{
public function __invoke(Request $request, $categories, $published_at, $ended_at = null, NewCount $formatter)
{
.
.
.
<?php
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
protected $connection = 'old-blog';
protected $table = 'posts';
}
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
@foreach($posts as $post)
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="{{ $post->name }}">
{
"id": 101,
"subject": "yish",
"description": "23232323",
"status": 0,
"created_at": "2017-05-10 07:46:11",
"updated_at": "2017-05-10 07:50:18"
}
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
protected $guarded = [];
<?php
namespace Illuminate\Database\Eloquent;
abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializable, QueueableEntity, UrlRoutable
{
.
.
.
.
/**
<?php
Route::get('posts/{post}', function(Post $post) {
return response()->json($post);
});