This file contains hidden or 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 | |
$attributes = $productAttributes | |
->pluck('attributesValues') | |
->flatten() | |
->unique() | |
->groupBy(function (AttributeValue $av) { | |
return $av->attribute->name; | |
}) | |
->map(function (Collection $collection) { |
This file contains hidden or 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
+----------+--------------------------------------------------------------+-------------------------------------+ | |
| Method | URI | Name | | |
+----------+--------------------------------------------------------------+-------------------------------------+ | |
| POST | account | account.create | | |
| POST | account/identify | account.identify | | |
| GET|HEAD | account/{account} | account.view | | |
| PATCH | account/{account} | account.update | | |
| DELETE | account/{account} | account.delete | | |
| POST | account/{account}/world | account.world.create |
This file contains hidden or 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
export PATH="~/.composer/vendor/bin:$PATH" | |
#alias php="/Applications/MAMP/bin/php/php5.5.38/bin/php" | |
#alias php="phpv" | |
function php { | |
CURRENT=`pwd` | |
if [ -a $CURRENT/.php ] | |
then |
This file contains hidden or 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
public function uninstall() | |
{ | |
/*$authnetpm = PaymentMethod::getByHandle('auth_net'); | |
if(is_object($authnetpm)){ | |
$authnetpm->delete(); | |
} | |
$invoicepm = PaymentMethod::getByHandle('invoice'); | |
if(is_object($invoicepm)){ | |
$invoicepm->delete(); | |
} |
This file contains hidden or 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
@SubscribeEvent | |
public void onEntityConstructing(EntityConstructing event) | |
{ | |
if (event.entity instanceof EntityAgeable) { | |
EntityAgeable child = (EntityAgeable) event.entity; | |
if (child.isChild()) { | |
List parents = child.worldObj.getEntitiesWithinAABBExcludingEntity(child, AxisAlignedBB.getBoundingBox(child.posX, child.posY, child.posZ, child.posX + 4D, child.posY + 4D, child.posZ + 4D)); | |
boolean flag = false; | |
int parentCount = 0; |
This file contains hidden or 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 | |
// This would be for the logs model | |
public function scopeCode($query, $code) | |
{ | |
return $query->where('code', $code); | |
} | |
// Then this would be your main model | |
public function scopeNotTransferred($query) |
This file contains hidden or 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
if($validator->fails()){ | |
return Response::json(['error' => 1, | |
'msg'=>$validator->errors() | |
]); | |
} | |
else{ | |
This file contains hidden or 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 | |
class Activity | |
{ | |
public static function log(Model $user, Model $subject, $action) | |
{ | |
$log = $this->user->logs()-.>create(['action'] => $action]); | |
$log->subject()->save($subject); | |
} |
This file contains hidden or 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 | |
class MyValidator extends BaseValidator | |
{ | |
public static $rules = [ | |
'create' => [ | |
'field' => ['rule1', 'rule2'] | |
], | |
'update' => [ |
This file contains hidden or 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 Ollieread\Toolkit\Repositories; | |
class BaseRepository | |
{ | |
public function setModel($model); | |
public function setValidator($validator); | |
public function setContext($context); |