Skip to content

Instantly share code, notes, and snippets.

View useless_eloquent_repository.php
* Example of useless Repository abstraction for Eloquent.
* From "Architecture of complex web applications" book.
interface PollRepository
//... some other actions
View Test.kt
class StringEloquentTableNameTest: TestCase() {
fun testEmpty() {
assertEquals("", "".getEloquentTableNameFromFqn())
fun testUser() {
assertEquals("users", "\\User".getEloquentTableNameFromFqn())
fun testNamespacedUser() {
View CustomViewCompiler.php
namespace App\Services;
use App\Contracts\IConferenceService;
use Symfony\Component\Debug\Exception\FatalThrowableError;
class CustomViewCompiler
public function getBladeResult($name, $bladeContents, array $data = [], $flushCache = false)
View CourseOpener.php
namespace App\Domain\Courses;
use App\Domain\Courses\Exam\ExamQuestion;
use App\Domain\Courses\Exam\ExamVersion;
use App\Exceptions\Courses\CourseCannotBeOpened;
class CourseOpener
View web.php
Route::group(['middleware' => 'guest'], function(){
Route::get('login', 'AuthController@getLogin');
Route::get('auth/google', 'AuthController@getAuth');
Route::get('auth/google/callback', 'AuthController@getCallback');
Route::get('auth/denied', 'AuthController@getDenied');
Route::group(['middleware' => 'auth'], function () {
// all other app routes here
You can’t perform that action at this time.