1657908660
A basic CakePHP + VueJS single page application. Provides basic skeleton/boilerplate to quickly get started with CakePHP and Vue.js.
Get project into your system
Via composer:
composer create-project ishanvyas22/cakephpvue-spa
Via cloning the project into your server:
git clone git@github.com:ishanvyas22/cakephpvue-spa.git
Install composer dependencies
composer install
Connect with your database
Run the migrations
bin/cake migrations migrate
Start CakePHP web server or create v-host to run this app.
npm install
npm run watch
npm run dev
npm run prod
Please see CHANGELOG for more information about recent changes.
I love to welcome your contributions if you know CakePHP / Vue.js.
Author: ishanvyas22
Source Code: https://github.com/ishanvyas22/cakephpvue-spa
License: MIT license
1657901160
Xeta is a resource to help people starting with Cake3.
Actually, I have developed this blog to try CakePHP 3 and for my needs (personal blog), and I have decided to release it to help people with CakePHP 3, so there is probably some custom configurations/functions that only fit my needs.
Dashboard
Blog Articles Management
Users Management
Install
If you need to install to try a function or any other things, just follow the steps bellow.
Steps to install :
composer create-project --prefer-dist xety/xeta <application_name>
composer run-script installation
You need to download the browscap.ini file.
vendor/bin/browscap-php browscap:fetch
vendor/bin/browscap-php browscap:convert
administrator
testaccount
Documentation
https://github.com/XetaIO/Xeta/wiki
Features
This project implements many features and will implements more in the future. Here's a list of the features developed in Xeta :
Blog
Admin Panel
Private Conversations
Star
ConversationsTwo Factor Authentication (TOTP)
Logs
Preview
Logs Events list :
Command | Description |
---|---|
user.connection.manual.success | Triggered when the user login on the login page. |
user.connection.manual.failed | Triggered when the user failed to login on the login page. |
user.connection.auto | Triggered when the user is automated login with Cookies. |
user.account.modify | Triggered when the user has modified his account. |
user.email | Triggered when the user has changed his Email. |
user.password.change | Triggered when the user has changed his password. |
user.password.reset | Triggered when the user has asked a password reset. |
user.password.reset.successful | Triggered when an user has successfully reset his password with the Email. |
2FA.enabled | Triggered when an user enbale the 2FA mode. |
2FA.disabled | Triggered when an user disable the 2FA mode. |
2FA.recovery_code.regenerate | Triggered when an user regenerate a new recovery code. |
2FA.recovery_code.used | Triggered when an user use his recovery code. |
WYSIWYG Editor (CKEditor)
All the CakePHP3's features that i use in the project are described here.
Information
If you want to contribute to the project by adding new features or just fix a bug, feel free to do a PR.
Contribute
Follow this guide to contribute
Special Thanks
Travis | Coverage | Scrutinizer | Stable Version | Downloads | License |
---|---|---|---|---|---|
Author: XetaIO
Source Code: https://github.com/XetaIO/Xeta
License:
1657893660
A collection of examples showing the best of the CakePHP 3 ORM
The SQL schema used for the examples can be found in the config/Schema/world.sql
file.
The slides that got this repo started can be found in the slides.pdf
file
Author: lorenzo
Source Code: https://github.com/lorenzo/cakephp3-examples
License:
1657889820
Example CakePHP codebase containing real world examples (CRUD, auth, advanced patterns and more) that adheres to the RealWorld spec and API.
This repo is functionality complete — PRs and issues welcome!
Getting started
Clone the repository
git clone git@github.com:gothinkster/cakephp-realworld-example-app.git
Switch to the repo folder
cd cakephp-realworld-example-app
Install all the dependencies using composer
composer install
Configure your database settings in the config/app.php
file(See: Datasource/default)
vi config/app.php
Run the database migrations (Set the database connection in app.php)
bin/cake migrations migrate
Start the local development server
bin/cake server
You can now access the server at http://localhost:8765
Populate the database with seed data with relationships which includes users, articles, comments, tags, favorites and follows. This can help you to quickly start testing the api or couple a frontend and start using it with ready content.
Run the database seeder and you're done
bin/cake migrations seed
This application adheres to the api specifications set by the Thinkster team. This helps mix and match any backend with any other frontend without conflicts.
For more information on how to this works with other frontends/backends, head over to the RealWorld repo.
How it works
Please check the official cakephp installation guide for server requirements before you start. Official Documentation
Code overview
src
- Contains all the application logic.config
- Contains all the application configuration files.src/Model/Entity
- Contains all cakephp ORM entites.src/Model/Table
- Contains all cakephp ORM tables.src/Service
- Contains application services that represents root api endpoints.src/Service/Action
- Contains application endpoints logic logic.src/Service/Renderer
- Contains the final api response formatter./config/Migrations
- Contains all the database migrations.config/app.php
- Configuration settings can be set in this fileNote : You can quickly set the database information and other variables in this file and have the application fully working.
Testing API
Run the cakephp development server
bin/cake server
The api can now be accessed at
http://localhost:8765/api
Request headers
Required | Key | Value |
---|---|---|
Yes | Content-Type | application/json |
Yes | X-Requested-With | XMLHttpRequest |
Optional | Authorization | Token {JWT} |
Refer the api specification for more info.
Authentication
This applications uses JSON Web Token (JWT) to handle authentication. The token is passed with each request using the Authorization
header with Token
scheme. The cakephp authenticate middleware configured for handling JWT authentication and validation and authentication of the token. Please check the following sources to learn more about JWT.
Cross-Origin Resource Sharing (CORS)
This applications has CORS enabled by default on all API endpoints. Please check the following sources to learn more about CORS.
Author: Gothinkster
Source Code: https://github.com/gothinkster/cakephp-realworld-example-app
License: View license
1657882320
CakePHP Application Example Using the Crud Plugin
This is an example applicaiton that implements the bookmarker tutorial form the CakePHP manual, but using the super powerful Crud plugin.
composer self-update
.php composer.phar create-project --prefer-dist -s dev lorenzo/cakephp3-bookmarker [app_name]
.Read and edit config/app.php
and setup the 'Datasources' and any other configuration relevant for your application.
After setting up the databse, load the tables
bin/cake migrations migrate
Author: lorenzo
Source Code: https://github.com/lorenzo/cakephp3-bookmarkr
License:
1657874880
A simple CakePHP 3 application to see how CakePHP 3 works !
composer self-update
.composer install
.config/app.php
with your databases informations (Search "Datasources")bin/cake server -p 8765
Then visit http://localhost:8765
to see the welcome page.
bin/cake migrations migrate
bin/cake migrations seed
Author: Kareylo
Source Code: https://github.com/Kareylo/BlogMVC-CakePHP3
License:
1657867320
QuickAppsCMS
Free open source content management system for PHP, released under GPL License and powered by CakePHP 3.0 MVC framework.
This is an unstable repository and should be treated as an alpha.
You must install QuickAppsCMS using composer. QuickAppsCMS is designed to run as a stand alone application, so you must use the website skeleton as starting point:
composer self-update
.php composer.phar create-project -s dev quickapps/website [your_website_name]
.If Composer is installed globally, run:
composer create-project -s dev quickapps/website [website_name]
After composer is done visit http://example.com/
and start QuickAppsCMS installation.
Author: Quickapps
Source Code: https://github.com/quickapps/cms
License: GPL-3.0 license
1657859880
CakeBlog is an open source blogging software. Written by George Whitcher in PHP with the CakePHP framework. CakeBlog like CakePHP requires Composer and PHP 5.6+.
composer update
to install CakePHP.app.default.php
to app.php
, cakeblog-config.default.php
to cakeblog-config.php
, cakeblog-functions.default.php
to cakeblog-functions.php
, and routes.default.php
to routes.php
bin/cake migrations migrate
.bin/cake migrations mark_migrated
admin
and password admin
is created by default. Please login by visiting http://domain.com/admin and change this immediately.Update
on the menu and download the files automatically from the latest GIT repository.bin/cake migrations migrate
. It is also suggested you update your CakePHP installation as well composer update
.NOTE: It is important NOT to make changes to the core CakeBlog files as they will be overwritten when updated.
Issues - Got issues? Please tell me! CakeBlog - CakeBlog Homepage.
Author: gwhitcher
Source Code: https://github.com/gwhitcher/CakeBlog
License:
1657852320
You can install this plugin into your CakePHP 3.x application using composer.
The recommended way to install composer packages is:
composer require skie/cakephp-phpstorm
After install plugin run
bin/cake CommandLine
to generate the custom xml file for PhpStorm Command Line Tools.
File stored into .idea/commandlinetools/Custom_ck.xml After that you should restart PhpStorm. After restart all shell comands should be available from command line tool (Ctrl+Shift+X) with detailed help.
Author: Skie
Source Code: https://github.com/skie/PhpStorm
License:
1657844820
IMPORTANT: This is not a deployment script, it's aimed to help developers installing CakePHP for the first time and get a working development environment up and running in seconds. Production environments should consider several other factors, like file permissions, virtualhost configuration, etc.
For bugs and feature requests, please use the issues section of this repository.
Commercial support is also available, contact us for more information.
This repository follows the CakeDC Plugin Standard. If you'd like to contribute new features, enhancements or bug fixes to the plugin, please read our Contribution Guidelines for detailed instructions.
Author: CakeDC
Source Code: https://github.com/CakeDC/oven
License: View license
1657837320
NetBeans CakePHP3/4 Plugin
This plugin provides support for CakePHP3/4.
You can update to the new version by the same way as the install. You don't have to uninstall the old version.
Enabled
If you just installed Cake3/4 via Composer, you don't have to do anything.
Use when your CakePHP app directory exists in your php project as a subdirectory.
e.g. set app
to Root setting like the following case:
source directory
├── foo
├── bar
└── app
├── README.md
├── bin
├── composer.json
├── composer.lock
├── config
├── index.php
├── logs
├── phpunit.xml.dist
├── plugins
├── src
├── tests
├── tmp
├── vendor
└── webroot
The same as App settings of config/app.php
Support them using .cake
file.
.cake
file.cake
filehome.ctp [Pages]
Component
// in your Controller e.g. SomeController or AppController
public $components = ['Foo', 'My.Bar', 'Bar' => ['className' => 'MyBar'] ];
public initialize() {
$this->loadComponent('Foo');
$this->laodComponent('Bar', ['className' => 'MyBar']);
}
// in your Controller
$this->[Ctrl+Space]
Helper
// in your Controller e.g. SomeController or AppController
public $helpers = ['Foo', 'My.Bar', 'Bar' => ['className' => 'MyBar'] ];
// in your template file e.g. index.ctp
$this->[Ctrl+Space]
Table
// in your Controller e.g. SomeController
$this->loadModel('Users');
// in your Controller
$this->[Ctrl+Space]
Please add @property
to your table class if you want to use like the following:
// e.g. BookmarksTable
/**
* @property \App\Model\Table\TagsTable $Tags
*/
class BookmarksTable extends Table {
}
$this->Bookmarks->Tags->[Ctrl+Space]
Method Parameters
// e.g. path/to/your/template/index.ctp
// file path completion
$this->Html->css('[Ctrl+Space]');
// constants
$this->Html->docType('[Ctrl+Space]');
NOTE Please add a semicolon(;) if you want to use code completions for parameters. Tips: You can add it like the following: Ctrl+;
This feature is not enabled by default. If you want to use it, please set the KeyMap to it. (Tools > Options > Keymap > Search CakePHP
> CakePHP3/4: Smart Go To > e.g. set Ctrl + Shift + J)
Files related to the current editor are shown when you run this action. e.g. If your current file is a Controller, template, table, entity, testcase, conponent and helper file(s) will be shown.
You can change a list to specific category's one like the following. (Ctrl is a Ctrl or Command key)
NOTE Core files are not shown (e.g. HtmlHelper, AuthComponent, e.t.c.)
You can use the .cake if you want to use the specified directories for Controller, Table, Template, e.t.c.. The file format is the following:
{
"cake": ".\/vendor\/cakephp\/cakephp",
"build_path": {
"entities": [
".\/src\/Model\/Entity\/"
],
"tables": [
".\/src\/Model\/Table\/"
],
"behaviors": [
".\/src\/Model\/Behavior\/"
],
"controllers": [
".\/src\/Controller\/"
],
"components": [
".\/src\/Controller\/Component\/"
],
"templates": [
".\/src\/Template\/"
],
"views": [
".\/src\/View\/"
],
"helpers": [
".\/src\/View\/Helper\/"
],
"consoles": [
".\/src\/Console\/"
],
"shells": [
".\/src\/Shell\/"
],
"tasks": [
".\/src\/Shell\/Task\/"
],
"locales": [
".\/src\/Locale\/"
],
"vendors": [
".\/vendor\/"
],
"plugins": [
".\/plugins\/"
]
}
}
NOTE It is not available in any categories.
You can add some directories(nodes) under the your project tree. Controller, Model, e.t.c. are shown by default. If you want to hide/show them, please change the options.(Tools > Options > PHP > Frameworks and Tools > CakePHP3/4 > Custom nodes)
Right-click a project > CakePHP3/4
All commands will be shown as a list in the command dialog. Then you can run a command with some parameters.
Just run cake server
. If you want to set details, please use Run Configuration
of project properties.
Please run this action after you changed the .cake
file or you updated the version of CakePHP. Refresh the version number and category paths.
If you have issues, please submit them to GitHub Issues . Please don't create PRs soon.
Author: junichi11
Source Code: https://github.com/junichi11/cakephp3-netbeans
License: Apache-2.0 license
1657829880
A plugin to discover and manage CakePHP plugins and generate skeleton application code.
You can install this plugin into your CakePHP application using composer.
The recommended way to install composer packages is:
composer require --dev cakedc/mixer
Ensure Mixer Plugin is loaded in your config/bootstrap.php file
if (Configure::read('debug')) {
Plugin::load('CakeDC/Mixer', ['bootstrap' => true, 'routes' => true]);
}
Now you can navigate to your app /mixer
URL and start discovery and managing your plugins! It searches through all packages on Packagist with type "cakephp-plugin" excluding CakePHP 2.x packages.
Attention: we don't want you to use Mixer in production. That's why we're asking to add it to require-dev
composer.json section and it will only work when debug
is on.
For bugs and feature requests, please use the issues section of this repository.
Commercial support is also available, contact us for more information.
This repository follows the CakeDC Plugin Standard. If you'd like to contribute new features, enhancements or bug fixes to the plugin, please read our Contribution Guidelines for detailed instructions.
Author: CakeDC
Source Code: https://github.com/CakeDC/mixer
License: View license
1657822440
Dockerfile for deploying your CakePHP application in a Docker container, able to connect to a remote database with database-based sessions and inject ENV vars to configure your application.
Based on Ubuntu 16.04 Xenial and PHP 7.0
Note: This project is meant to be an example to study the basics and essentials of CakePHP in a Docker environment, therefore it is build on an Ubuntu base image rather then a PHP base image, uses a 'simple' webserver like Apache and has some non-efficient commands to demonstrate stuff.
You can edit the Dockerfile
to add your own git, composer or custom commands to add your application code to the image.
To create the image myvendor/mycakephpapp
, execute the following command on the docker-cakephp directory:
docker build -t myvendor/mycakephpapp .
Optional: You can now push your new image to a registry:
docker push myvendor/mycakephpapp
Start your image forwarding container port 80 to localhost port 80:
docker run -d -p 80:80 myvendor/mycakephpapp
Start a MySQL container
docker run -d \
--name mysql-server \
-e MYSQL_ROOT_PASSWORD=sekret \
-e MYSQL_DATABASE=cakephp \
mysql:5.7
Start your image and:
database
session handler using our the SESSION_DEFAULTS env variable (see Dockerfile
for implementation)docker run -d -p 80:80 \
--name cakephp \
-e "DATABASE_URL=mysql://root:sekret@mysql-server/cakephp?encoding=utf8&timezone=UTC&cacheMetadata=true" \
-e "SESSION_DEFAULTS=database" \
--link mysql-server:mysql \
myvendor/mycakephpapp
Visit http://localhost/
in your browser or
curl http://localhost/
You can now start using your CakePHP container!
Dockerfile
to sed
the config/app.php
file to use the database or cache session handler as implemented in the example.volumes
or an object storage with a webservice interface like Amazon S3.Author: Stefanvangastel
Source Code: https://github.com/stefanvangastel/docker-cakephp
License: MIT license
1657815000
This will generate the config files needed to get your vagrant environment setup for cakePHP running on Ubuntu 20.04 with PHP 7.4 on nginx.
To run the generator use the following command:
curl -sS https://raw.githubusercontent.com/cpierce/cakephp-vagrant-setup/master/scripts/vagrant_setup.php | php -- --ip 192.168.33.77 --hostname dev.cpierce.org
After the Vagrant file is created you can simply use the vagrant up
command to start provisioning your local environment!
This will install the Vagrantfile you'll need. All available options are listed in the table below.
Option | Description | Example |
---|---|---|
ip | IP Address for your virtual machine to use. | --ip 192.168.33.77 |
hostname | Hostname to use for virtual environment. | --hostname dev.cpierce.org |
memory-limit | Amount of memory in MB virtual environment should consume when running. | --memory-limit 1024 |
cpu-limit | Number of virtual CPUs to give virtual environment. | --cpu-limit 1 |
skip-host | Skip the echo of the hostfile information if you don't want to do the sudo tee -a /etc/hosts part or do the host setup manually. | --skip-host |
Note: While you can have multiple hosts with the same IP Address, you cannot run them at the same time so it is always recommended to change the host IP Address for each configuration you setup. Note: Also thanks to Google making .dev (TLD) a require https on the HSTS you'll now have to either use another tld that isn't real or just do what I've been doing and update the dns for your domain such as dev.cpierce.org
. One benefit of this is that you don't have to make changes to your host file and multiple people can use the same dev hostname. If you don't know how to do this you are welcome to use the default http://dev.cpierce.org/ to develop with.
Author: cpierce
Source Code: https://github.com/cpierce/cakephp-vagrant-setup
License: MIT license
1657807560
A cakephp/app template for Docker Compose and Kubernetes. You might also be interested in CakePHP Galley which is similar to Laravel Sail or DevilBox.
Service | Host:Port | Docker Host | Image |
---|---|---|---|
PHP8.0-FPM w/ Xdebug 3 | - | php | cnizzardini/php-fpm-alpine:8.0-latest |
NGINX 1.19 | localhost:8080 | web | nginx:1.19-alpine |
MySQL 8 | localhost:3607 | db | library/mysql:8 |
Fork and clone this repository then run:
make init
That's it! Now just remove app/*
from .gitignore. You may also want to remove .assets and adjust defaults in .github, .docker, and .kube.
Note:
make init
andmake init.nocache
output interactively, whilemake start
andmake up
do not.
Change your SHELL
in the Makefile to /bin/zsh
. This improves various output from the Makefile such as emoji's.
Mac ships with an older version of sed
so install gnu-sed
for some targets in the Makefile:
brew install gnu-sed
Then update sed
to gsed
in the Makefile.
After install browse to http://localhost:8080 to see the CakePHP welcome page.
A Makefile is provided with some optional commands for your convenience. Please review the Makefile as these commands are not exact aliases of docker-compose commands.
Make Command | Description |
---|---|
make | Shows all make target commands |
make init | Runs docker build, docker-compose up, and copies over env files |
make init.nocache | Same as make.init but builds with --no-cache |
make start | Starts services docker-compose -f .docker/docker-compose.yml start |
make stop | Stops services docker-compose -f .docker/docker-compose.yml stop |
make up | Create and start containers docker-compose -f .docker/docker-compose.yml up -d |
make down | Take down and remove all containers docker-compose -f .docker/docker-compose.yml down |
make restart | Restarts services docker-compose -f .docker/docker-compose.yml restart |
make php.sh | PHP terminal docker exec -it --user cakephp <PHP_CONTAINER> sh |
make php.restart | Restarts the PHP container |
make db.sh | DB terminal docker exec -it <DB_CONTAINER> sh |
make db.mysql | MySQL terminal mysql -u root -h 0.0.0.0 -p --port 3307 |
make web.sh | Web terminal docker exec -it <WEB_CONTAINER> sh |
make xdebug.on | Restarts PHP container with xdebug.mode set to debug,coverage |
make xdebug.off | Restarts PHP container with xdebug.mode set to off |
make composer.install | docker exec <PHP_CONTAINER> composer install --no-interaction |
make composer.test | docker exec <PHP_CONTAINER> composer test |
make composer.check | docker exec <PHP_CONTAINER> composer check |
See .docker/README.md for details.
Shell:
make php.sh
Helper commands:
make composer.install
make composer.test
make composer.check
See .docker/README.md for details.
Shell:
make db.sh
MySQL shell (requires mysql client on your localhost):
make db.mysql
See .docker/README.md for details.
Shell:
make web.sh
Xdebug is disabled by default. To toggle:
make xdebug.on
make xdebug.off
Xdebug 3's default port is 9003
.
Go to File > Settings > Languages & Frameworks > PHP > Servers
localhost
localhost
8080
Xdebug
Enable
Map your project's app directory to the absolute path on the docker container /srv/app
To completely reinstall delete existing containers and images, then remove the app/
directory and run make init
again.
Author: Cnizzardini
Source Code: https://github.com/cnizzardini/cakephp-docker
License: MIT license