This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class StringEloquentTableNameTest: TestCase() { | |
fun testEmpty() { | |
assertEquals("", "".getEloquentTableNameFromFqn()) | |
} | |
fun testUser() { | |
assertEquals("users", "\\User".getEloquentTableNameFromFqn()) | |
} | |
fun testNamespacedUser() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Domain\Courses; | |
use App\Domain\Courses\Exam\ExamQuestion; | |
use App\Domain\Courses\Exam\ExamVersion; | |
use App\Exceptions\Courses\CourseCannotBeOpened; | |
class CourseOpener | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |