https://github.com/ADmad/cakephp-jwt-auth
Thursday, October 18, 2018
CakePhp Eluquent Subquery Example
public function beforeSave(Event $event, Entity $entity){
}
public function initialize(array $config)
{
$this->addBehavior('Timestamp'); //gestion des colonnes created et modified
$this->hasMany('ForumPosts');
$this->hasOne('LastForumPost', [
'className' => 'ForumPosts',
'foreignKey' => false,
'conditions' => function ($exp, $query) {
$subquery = $query
->getConnection()
->newQuery()
->select(['SubLastForumPost.id'])
->from(['SubLastForumPost' => 'forum_posts'])
->where([
'SubLastForumPost.draft = false', //to remove for admin
'SubLastForumPost.created IS NOT NULL',
'ForumCategories.id = SubLastForumPost.forum_category_id',
'SubLastForumPost.parent_id IS NULL'])
->order(['SubLastForumPost.created' => 'DESC'])
->limit(1);
return $exp->add(['LastForumPost.id' => $subquery]);
}
]);
}From cakephp forum
Wednesday, October 3, 2018
Wednesday, December 20, 2017
stripe payment gateway
http://justlaravel.com/integrate-stripe-payment-gateway-laravel/?utm_source=learninglaravel.net
Subscribe to:
Posts (Atom)
-
https://www.nicesnippets.com/blog/laravel-9-comment-system-example-tutorial
-
Organization : Keeping each site's configuration in separate files makes the server easier to manage, especially when hosting multiple...
-
On one end of the spectrum, you have your no-code dogmatics. On the other end, you have your fancy tech stack enthusiasts. In the middle a...