CakeDC Blog

TIPS, INSIGHTS AND THE LATEST FROM THE EXPERTS BEHIND CAKEPHP

Cake Development Corporation - The ben...

  Cake Development Corporation was established in 2007 by Larry Masters, one of the founders of CakePHP. CakeDC provides professional development and consultancy services for a range of business needs, including startups, e-commerce and enterprise level corporations. Besides being experts behind the CakePHP framework, the team is backed by 50 years of combined experience. The team is highly talented, extremely approachable and work as a focused team when putting forward any piece of work. When the company was developed, the proposal was simple: to create a commercial entity that allows people to live and breathe CakePHP, doing what they love day-to-day, while also providing everyone with a means. Did we mention that we are based all over the world? Working remotely? – it’s one of the many benefits you sign into when working for CakeDC. We're an international team that offers commercial support and professional training for one of the most popular PHP frameworks used by developers around the world. But being based all over the world, we do look for key individuals to work with us. Some of the key aspects we look for in the ideal candidate include:

  • Good track history of Work Commitment and demonstrates good work ethic
  • Someone with full knowledge and/or experience of a full development cycle
  • Someone that demonstrates that they have good team spirit and takes initiatives
  • Ensuring they fulfill the qualifications outlined in the job post
For us at Cake Development Corporation, we feel that working remotely affords our employees a variety of benefits. Below are some of the main benefits from our team working remotely vs. being all centrally located.
  • With Remote employees we tend to have a lot more personal satisfaction which drives us to be independent.
  • Being based remotely, you obtain good results because the commitment is not pressuring for time, and being confined or distracted in a room with persons that may pose these issues.
  • We find that being a remote employee usually leads to being goal oriented and having the will to take the risk in working for as long as they want. Leaving the option be compensated for every hour of it and also doing exactly what they want.
  • Remote employees tend to be more productive as they are working in a conducive environment suited to their specific and individual needs.
At the Cake Development Corporation, we look out for employees who show
  • Discipline
  • Honesty and accountability
  • Ambitious
  • Focused
  • If Experienced, Demonstrate that experience
The distance doesn’t come in the way of getting to know our team or in the way of delivery impeccable work – with daily chats, catchups and integration tools, the team functions just like any other! CakeDC is on the forefront of modern organisations, recruiting top software developers and delivering top notch solutions to their clients! We are a dynamic company based on meritocracy, where everyone is given the opportunity to make an impact on the various levels and disciplines of the business, as well as playing a key role in the CakePHP community as the commercial entity behind the framework - the opportunity for growth is endless. And we haven’t even really gone into the real company benefits.. At CakeDC, everyone is appreciated, recognised and given the space and opportunity to grow. Some of our many benefits include:
  • 100% flexible work schedules, you are given the choice to define your hours of availability, 36 hours minimum required per week..
  • Remote working environment with an international team and clients.
  • The opportunity to Engage in paid open source projects, becoming an integral part of the development of the community. At CakeDC, all developers work 20% of their (paid development) time on open source projects.
  • Annual performance based bonuses.
  • Paid Parental Leave. Up to 16 weeks maternity leave and up to 6 weeks paternity leave, at 100% paid salary. Single fathers, or primary caregivers, can also take up to 16 weeks.
  • Available vacation time:
    • 10 days working days (not including weekends) per year. A minimum time of 12 months working at the company is required to take vacation.
    • 20 days working days (not including weekends) per year. A minimum time of 24 months working at the company is required to take vacation.
    • 30 working days (not including weekends) per year.A minimum time of 36 months working at the company is required to take vacation.
    • Christmas and New years are Company Paid Vacations.
  • Team outings and meetups – Don’t think that because this team is based internationally that we don’t know each other. We know the importance of getting together once in awhile, so we have annual meet ups!
  • A fully paid for IDE (PHPStorm) licence to assist you with our work and make your life a little easier.
So how do you know if you are right to apply to be a part of CakeDC? Well, if you aren’t shy, you know your stuff (Web application development, object orientated analysis and design, and of course, knowledge of CakePHP), are willing to put yourself out there and learn, and have a zest for life – then we are the right place for you!

CakePHP Facebook login using CakeDC Us...

The CakeDC Users Plugin provides an easy way to integrate Facebook social login into your application. Note this is the updated tutorial for the latest version of the plugin 3.1.5. This is a short how-to tutorial to enable Facebook login. We'll assume you have a brand new CakePHP 3.2+ application already setup.

Setup

Use composer to install the CakeDC Users Plugin composer require cakedc/users composer require league/oauth2-facebook:@stable Note we've upgraded to use league/oauth2 lib, and the old and not maintained opauth library was removed. Load it from your bootstrap.php file Plugin::load('CakeDC/Users', ['routes' => true, 'bootstrap' => true]); Run migrations to add 2 new tables: 'users' and 'social_accounts' bin/cake migrations migrate -p CakeDC/Users

Configuration

Load the Component in your src/Controller/AppController.php public function initialize() { parent::initialize(); // // ... // $this->loadComponent('CakeDC/Users.UsersAuth'); } login page output

Create a new Facebook application

  • Go to Facebook developers and log in
  • Create a new Facebook application new Facebook app
  • Click "website" and select some awesome name for your brand new app (yeah, some random name would work too)
  • Pick a Category, complete the quick start form, etc.
  • Once you are done, go to your newly created app and click "settings"
  • In settings, you should add your domain to "App domains" and ensure there is at least one login platform = "Website" defined
  • Copy your App ID and secret

Setup the Plugin to use your Facebook app for login

Now you have a working Facebook app configured, we are going to link the CakeDC Users Plugin to use the app for login. Update your bootstrap.php file to customize the CakeDC Users Plugin Configure::write('Users.config', ['users']); Plugin::load('CakeDC/Users', ['routes' => true, 'bootstrap' => true]); Create a new "config/users.php" file with contents return [ 'Users.Social.login' => true, 'OAuth.providers.facebook.options.clientId' => 'YOUR APP ID', 'OAuth.providers.facebook.options.clientSecret' => 'YOUR APP SECRET', //etc ]; This file will override any configuration key present in the Plugin, you can check the configuration options here Configuration. You are done! Now the "login with Facebook" link (in "/login" page) will open the Facebook login popup and connect back to your application. If the email is provided by the user, he'll be automatically registered using the default role = 'user'. If no email is provided, the user will be requested to enter an email to complete the registration process in your application. Once his email is validated (link sent via email), he'll be able to login using Facebook.

Read more about CakeDC Users Plugin

Giving back to the community

This Plugin's development has been sponsored by the Cake Development Corporation. Contact us if you are interested in:
  • Professional, commercial CakePHP development and consultancy
  • Professional CakePHP training
  • CakePHP code reviews
We hope you've enjoyed this short tutorial covering the Facebook login, stay tunned for new CakePHP + Users Plugin tutorials coming soon...  

CakeDC Users Plugin for CakePHP 3 - Up...

Welcome to our updated tutorial covering the new CakeDC Users Plugin for CakePHP 3. In this tutorial we'll setup and configure the Plugin, introducing some of the available features. Note this is the updated tutorial for the latest version of the plugin 3.1.5. We'll assume you are starting a new CakePHP 3.2.x application, with some existing tables (blog site maybe?).

Setup

Easy thing, let's use composer to install the CakeDC Users Plugin composer require cakedc/users Now ensure the Plugin is loaded from your bootstrap.php file Plugin::load('CakeDC/Users', ['routes' => true, 'bootstrap' => true]); Create some tables to store the users in your database bin/cake migrations migrate -p CakeDC/Users This migration will create 2 tables into your database, "users" where the users and credentials are stored, and "social_accounts" where the tokens for the social login feature will be stored and managed. Now you can register a new user (ensure your CakePHP is able to send emails to get your validation link correctly), or you could use the provided shell to create new users from the command line bin/cake users addSuperuser output for the shell command to generate new superuser This new super user will be granted full administrative permissions (check the src/Auth/SuperuserAuthorize class for more details and configuration)

Configuration

Load the Component in your src/Controller/AppController.php public function initialize() { parent::initialize(); // // ... // $this->loadComponent('CakeDC/Users.UsersAuth'); } login page output Now you have the Plugin installed and a brand new superuser granted with full permissions, it's time to configure permissions for the rest of the roles you'll need.

Simple role based permission rules

By default, the CakeDC Users Plugin allow users to register, and all new users are assigned role = 'user' by default. Note you can change the default role name assigned to new users, but we'll keep the 'user' role for now. Let's assume you have some controller with a couple actions you want to allow, for example "/posts/view/*" We are going to configure SimpleRBAC to allow the role = 'user' accessing the 'view' action: Create a new file "config/permissions.php" with the following contents return [ 'Users.SimpleRbac.permissions' => [ [ 'role' => 'user', 'controller' => 'Posts', 'action' => ['view'], ], ] ]; Now you've defined your first permission rule, allowing users with role = 'user' to access the /posts/view action, note you can use wildcards '*', and arrays to cofigure your rules. Cool, so now you have users in your application, allowing new users to register, validate their emails, login, change password, and use cookies to remember login. In our next short tutorial we'll cover Facebook login and Twitter login.

Ownership

What about ownership? We are talking about posts, and possibly you'll need to allow the post author to edit his own post, the good news: this is super easy with CakeDC Users Plugin. We'll assume you have a user_id column in your posts table to support the association Posts belongsTo Users. Add a new rule to allow only the owner of a given post to edit it. Update your permissions.php file, adding this rule: use Cake\ORM\TableRegistry; use CakeDC\Users\Auth\Rules\Owner; return [ 'Users.SimpleRbac.permissions' => [ [ 'role' => 'user', 'controller' => 'Posts', 'action' => ['view'], ], [ 'role' => 'user', 'controller' => 'Posts', 'action' => ['edit', 'delete'], 'allowed' => new Owner(), ], ] ]; And we're done, you've configured ownership permissions for your ['edit', 'delete'] actions. Check other examples in the CakeDC Users Plugin Docs

Read more about CakeDC Users Plugin

Giving back to the community

This Plugin's development has been sponsored by the Cake Development Corporation. Contact us if you are interested in: We'll continue working on our open source plugins (like this one) to give back to the amazing CakePHP Community!  

BOOK A 15 MINUTES FREE
CONSULTING WITH US:

Announcement: CakeDC acquires ZenServ

Cake Development Corporation is pleased to announce that effective January 11, 2016, it will aquire ZenServ, Inc. Over the past years we have seen a steady growth in our client base between 15 to 25 active clients annually. With consistent achievement, we have managed to improve our expertise in Health, Financial, Social Media, Arts, Gaming & Entertainment, Auto, Education and Information Technology to name a few. The acquisition will pool together ZenServ's proven track record in mobile, web design, and web development with CakeDC's rock-solid leadership in CakePHP Framework customization and development. Both companies are regarded highly for their ability to produce high quality professional work using leading edge technology. CakeDC's eminence as the premier company people turn to for CakePHP framework development is already well-established while Zenserv is at the forefront in the highly competitive world of mobile, web, and IOS development. Combined, these two sets of crucial technical talents will expand CakeDC's service portfolio and significantly bolster its ability to render even more services to its customers. Focusing on superior customer service that has been the hallmark of Cake Development Corporation and will continue to be its top priority. ZenServ fully shares this philosophy and is the secret behind its steady growth and success. Our customers will therefore continue to receive the high level of service they have come to expect from us. The key ingredients that continues to aid in successful business delivery is the strong team that supports the CakePHP framework and strong third party application relationships. Therefore, we are very excited about this strategic acquisition. As we embark on this joint venture into the future, please join us in welcoming the entire workforce and customers of ZenServ. Happy New Year!

CakePHP Facebook login using CakeDC Us...

IMPORTANT: This tutorial is old, please check the updated Facebook version for CakeDC Users Plugin 3.1.5
  If you are using an old version, we recommend to migrate to latest version of the plugin. We'll keep this article online for some more time....   The CakeDC Users Plugin provides an easy way to integrate Facebook social login into your application. This is a short how-to tutorial to enable Facebook login. We'll assume you have a brand new CakePHP 3 application already setup.

Setup

Use composer to install the CakeDC Users Plugin composer require cakedc/users:~3.1.0 composer require opauth/opauth:1.0.x-dev composer require opauth/facebook:1.0.x-dev Now update your composer.json file adding the following repository override, to use our own fork of the Facebook Strategy, as the main repo is not maintained "repositories": [ { "type": "vcs", "url": "https://github.com/CakeDC/facebook.git" } ], Note we are using the 3.1 version, matching the CakePHP 3.1 compatible version of the Plugin, check the compatibility matrix to find the right version for your current CakePHP version. Load it from your bootstrap.php file Plugin::load('CakeDC/Users', ['routes' => true, 'bootstrap' => true]); Run migrations to add 2 new tables: 'users' and 'social_accounts' bin/cake migrations migrate -p CakeDC/Users

Configuration

Load the Component in your src/Controller/AppController.php public function initialize() { parent::initialize(); // // ... // $this->loadComponent('CakeDC/Users.UsersAuth'); } login page output

Create a new Facebook application

  • Go to Facebook developers and log in
  • Create a new Facebook application new Facebook app
  • Click "website" and select some awesome name for your brand new app (yeah, some random name would work too)
  • Pick a Category, complete the quick start form, etc.
  • Once you are done, go to your newly created app and click "settings"
  • In settings, you should add your domain to "App domains" and ensure there is at least one login platform = "Website" defined
  • Copy your App ID and secret

Setup the Plugin to use your Facebook app for login

Now you have a working Facebook app configured, we are going to link the CakeDC Users Plugin to use the app for login. Update your bootstrap.php file to customize the CakeDC Users Plugin Configure::write('Users.config', ['users']);   Plugin::load('CakeDC/Users', ['routes' => true, 'bootstrap' => true]); Create a new "config/users.php" file with contents return [ 'Opauth.Strategy.Facebook.app_id' => 'YOUR APP ID', 'Opauth.Strategy.Facebook.app_secret' => 'YOUR APP SECRET', //etc ]; This file will override any configuration key present in the Plugin, you can check the configuration options here Configuration. You are done! Now the "login with Facebook" link (in "/login" page) will open the Facebook login popup and connect back to your application. If the email is provided by the user, he'll be automatically registered using the default role = 'user'. If no email is provided, the user will be requested to enter an email to complete the registration process in your application. Once his email is validated (link sent via email), he'll be able to login using Facebook.

Read more about CakeDC Users Plugin

Giving back to the community

This Plugin's development has been sponsored by the Cake Development Corporation. Contact us if you are interested in:
  • Professional, commercial CakePHP development and consultancy
  • Professional CakePHP training
  • CakePHP code reviews
We hope you've enjoyed this short tutorial covering the Facebook login, stay tunned for new CakePHP + Users Plugin tutorials coming soon...  

We Bake with CakePHP