Skip to content

Instantly share code, notes, and snippets.

class StringEloquentTableNameTest: TestCase() {
fun testEmpty() {
assertEquals("", "".getEloquentTableNameFromFqn())
}
fun testUser() {
assertEquals("users", "\\User".getEloquentTableNameFromFqn())
}
fun testNamespacedUser() {
<?php
/**
* Example of useless Repository abstraction for Eloquent.
* From "Architecture of complex web applications" book.
* https://adelf.tech/2019/architecture-of-complex-web-applications
*/
interface PollRepository
{
//... some other actions
<?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)
<?php
namespace App\Domain\Courses;
use App\Domain\Courses\Exam\ExamQuestion;
use App\Domain\Courses\Exam\ExamVersion;
use App\Exceptions\Courses\CourseCannotBeOpened;
class CourseOpener
{
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