Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):
class Shop extends Eloquent {}
Using custom table name
protected $table = 'my_shops';
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
<?php | |
/* From https://www.usps.com/send/official-abbreviations.htm */ | |
$us_state_abbrevs_names = array( | |
'AL'=>'ALABAMA', | |
'AK'=>'ALASKA', | |
'AS'=>'AMERICAN SAMOA', | |
'AZ'=>'ARIZONA', | |
'AR'=>'ARKANSAS', |
;(function () { | |
function domReady (f) { /in/.test(document.readyState) ? setTimeout(domReady,16,f) : f() } | |
function resize (event) { | |
event.target.style.height = 'auto'; | |
event.target.style.height = event.target.scrollHeight+'px'; | |
} | |
/* 0-timeout to get the already changed text */ | |
function delayedResize (event) { | |
window.setTimeout(resize, 0, event); |
<?php | |
class ExampleTest extends TestCase { | |
public function setUp() | |
{ | |
parent::setUp(); | |
DB::beginTransaction(); | |
} |
For the scenario, imagine posts has a foreign key user_id referencing users.id
public function up()
{
Schema::create('posts', function(Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('body');
Setting up Sendy with Laravel | |
(there might be bugs, I striped out some parts of my code because what I have is more complicated then that, so, sorry if it's broken!) | |
-- | |
I would recommand creating a database for Sendy only. | |
Add Sendy's database into your database.php (1) | |
Create the Campaign model (2), and specify that you want to use Sendy's database (Campaigns are the only thing we really need to create, other things like creating lists can be done through Sendy interface, and there is a PHP library to add subscribers) | |
Now, it's time to install Sendy, usually somewhere like yourapp.com/sendy or yourapp.com/newsletter |
/* | |
This is a very simple snippet about how to create a database 1st, | |
a user and then assign some privileges to the user to allow him/her to | |
perform some specific actions like insert, create, update, select etc. | |
Source: http://www.apphp.com/index.php?snippet=mysql-create-database-and-assign-user | |
*/ | |
-- Create database, user and grant all privileges | |
CREATE DATABASE database_name; | |
CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'password'; |
{ | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:DeleteObject", | |
"s3:GetObject", | |
"s3:PutObject", | |
"s3:PutObjectAcl" | |
], |
[ | |
{ | |
"command": "escape" | |
}, | |
{ | |
"command": "expand_selection", | |
"args": {"to": "word"} | |
}, | |
{ | |
"command": "copy" |