-
Laravel with SSL through Cloudflare on Heroku.
I deployed a Laravel app on Heroku, using Cloudflare for SSL. As a quick note, here’s how I did it. NOTE: if you’re using Laravel 5.4 or higher it’s forceScheme instead of forceSchema Also, you need to set your Laravel environment variable APP_ENV to production (or at least something else than local). Do this in…
-
Use include method in IE
Here’s a hack for using the includes method also in the horrible Internet Explorer.
-
Serve Laravel to the web
This will make your Laravel instance available on the web. Make sure your router have port 80 forwarded to your machine. Also make sure no other server applications is blocking the port.
-
Sort array of objects by property value
Sort by predefined order:
-
Add column to table in Laravel
Create migration in console: Use Schema::table() to access existing table (instead of Schema::create() for creating new tables) Then run migrations:
-
Allow Composer to connect to http/https
If you have problems with Composer not allowing to update to http-connections add this to composer.json (not recommended to keep in production)
-
(WordPress) Generate post title from custom field
I had a custom post type that only used custom fields, so I needed to generate a post title from there. Here’s one way. You can if course chain as many if else as you want to check other types. functions.php [php] function custom_post_type_title($post_id) { global $wpdb; if (get_post_type($post_id) == ‘staff’) { $name = get_post_custom_values(‘name’);…
-
Laravel helpful plugins
Generate Seed from Databasehttps://github.com/orangehill/iseed Generate Migrations from Database:https://github.com/Xethron/migrations-generator
-
(JS) Newline to br
Replaces newline characters with <br> tags in the same style as the php nl2br function
-
(Ruby) Ruby on Rails doodles
Create new Ruby-on-Rails project. By default RoR comes with SQLite support, unless you state otherwise (-d mysql). [ruby] // Create project. With mysql support rails new my_project -d mysql [/ruby]
-
(MySQL) MySQL doodles
[sql] — Replace a word or string in a column UPDATE my_table SET my_column = REPLACE(my_column, ‘Old string’, ‘New string’); — [/sql]