Laravel
Useful info to start a Laravel project:
https://devcenter.heroku.com/articles/getting-started-with-laravel
Heroku
url
https://salty-tor-99908.herokuapp.com/
MySQL
Be sure to configure your .env file with a MySQL db config.
Added auto deploy from master branch into Heroku
Solved on feature branch test-browser-info
Custom helper functions added to helper file.
Reference link:
- Within your app/Http directory, create a helpers.php file and add your functions.
- Within composer.json, in the autoload block, add "files": ["app/Http/helpers.php"].
- Run composer dump-autoload
Already merged to master
Create migration for sessions table:
php artisan make:migration create_sessions_table --create=sessions
Create migration for tasks table:
php artisan make:migration create_tasks_table --create=tasks
Run the migrations:
php artisan migrate
Make the models:
php artisan make:model Session
php artisan make:model Task
Make the controllers:
php artisan make:controller TaskController --resource
To list the current routes:
php artisan route:list
Useful link on how to have multiple route files:
http://laravel-tricks.com/tricks/laravel-5-multiple-routes-files
Use this add-on on Firefox to test the API locally:
https://addons.mozilla.org/en-US/firefox/addon/poster/
Mapping of tasks:
- TaskController@index
- list
- http://192.168.33.10/todo-app/public/task
- TaskController@store
- create new task
- http://192.168.33.10/todo-app/public/task
- TaskController@update
- update an existing task
- http://192.168.33.10/todo-app/public/task/{id}
- TaskController@destroy
- "delete" a task
- http://192.168.33.10/todo-app/public/task/{id}
Add bower to handle all the front end dependencies
npm install -g bower
Setup bower to change the default folder of the dependencies:
https://laracasts.com/discuss/channels/general-discussion/laravel-5-bower
http://jordijoan.me/integrating-bower-laravel/
Create a bower.json file to declare the front end dependencies.
Then install them:
bower install
The chosen stylesheet engine is sass
To compile the sass files you can add a watcher or compile them with grunt, gulp or directly.
Laravel by default has a gulpfile, but first gulp has to be added to the project:
npm install gulp
Then alter the gulpfile (gulpfile.js) to include your custom scss files and run gulp:
gulp
Adding gulp-strip-debug package to remove logs from javascript files:
npm install --save-dev gulp-strip-debug
https://www.npmjs.com/package/gulp-strip-debug
Add an extra field to the tasks table to add a cleared field:
php artisan make:migration add_cleared_field_tasks_table
Run the migrations:
php artisan migrate