A blog series for PHP developers working on larger-than-average Laravel projects
Written for projects with a development lifespan of six to twelve months, with a team of three to six developers working on them simultaneously.
<?php | |
namespace App\Traits; | |
use App\User; | |
use DateTime; | |
use GuzzleHttp\Psr7\Response; | |
use Illuminate\Events\Dispatcher; | |
use Laravel\Passport\Bridge\AccessToken; | |
use Laravel\Passport\Bridge\AccessTokenRepository; |
<?php | |
use Illuminate\Foundation\Testing\WithoutMiddleware; | |
use Illuminate\Foundation\Testing\DatabaseMigrations; | |
use Illuminate\Foundation\Testing\DatabaseTransactions; | |
class ExamplePassportTest extends \PassportTestCase | |
{ | |
use DatabaseTransactions; |
http://stackoverflow.com/questions/5082738/ios-calling-app-delegate-method-from-viewcontroller | |
http://stackoverflow.com/questions/4399611/force-iphone-app-to-restart-programmatically | |
// call delegate method | |
MainClass *appDelegate = (MainClass *)[[UIApplication sharedApplication] delegate]; | |
[appDelegate.viewController resetAppToFirstController]; | |
- (void)resetAppToFirstController | |
{ |
<?php | |
namespace App\Traits; | |
use DateTimeImmutable; | |
use Laravel\Passport\Bridge\Scope; | |
use Modules\User\Models\User; | |
use GuzzleHttp\Psr7\Response; | |
use Illuminate\Events\Dispatcher; | |
use Laravel\Passport\Bridge\AccessToken; |
<?php | |
#source: http://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-char | |
function replace_unicode_escape_sequence($match) { | |
return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); | |
} | |
function unicode_decode($str) { | |
return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', 'replace_unicode_escape_sequence', $str); | |
} |
<?php | |
namespace OpenObjects\Bundle\CoreBundle\Service; | |
use Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationMapper; | |
use Symfony\Component\Form\Form; | |
use Symfony\Component\Form\FormError; | |
use Symfony\Component\Validator\ConstraintViolation; | |
/** |
/** | |
Problem: | |
You have a javascript array that likely has some duplicate values and you would like a count of those values. | |
Solution: | |
Try this schnippet out. | |
*/ |
<?php | |
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* @ORM\Entity() | |
* @ORM\Table(name="user") | |
*/ | |
class User |