MAIL_DRIVER=smtp
MAIL_HOST=localhost
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// routes/console.php | |
// quickly create an user via the command line | |
Artisan::command('user:create', function () { | |
$name = $this->ask('Name?'); | |
$email = $this->ask('Email?'); | |
$pwd = $this->ask('Password?'); | |
// $pwd = $this->secret('Password?'); // or use secret() to hide the password being inputted | |
\DB::table('users')->insert([ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In the invalidHandler, you are passed two arguments, a jQuery.Event and the validator object. | |
// You don't need to call validate within your invalidHandler to get the validate object. | |
// Further, the validator object has a properties called errorList and errorMap, which contain the information you are looking for. | |
invalidHandler: function(e,validator) { | |
//validator.errorList contains an array of objects, where each object has properties "element" and "message". element is the actual HTML Input. | |
for (var i=0;i<validator.errorList.length;i++){ | |
console.log(validator.errorList[i]); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// this script would save csv file to this specified directory | |
// APPPATH is location of application folder in Codeigniter | |
$file = fopen(APPPATH . '/../upload/'.'tesaasasat.csv', 'wb'); | |
// set the column headers | |
fputcsv($file, array('Column 1', 'Column 2', 'Column 3', 'Column 4', 'Column 5')); | |
// Sample data. This can be fetched from mysql too | |
$data = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
# Successfully redirect all pages of domain from http to https: | |
# Note this will redirect using the 301 'permanently moved' redirect, which will help transfer your SEO rankings. | |
# To redirect using the 302 'temporarily moved' change [R=302,L] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Combines SQL and its bindings | |
* | |
* @param \Eloquent $query | |
* @return string | |
*/ | |
public static function getEloquentSqlWithBindings($query) | |
{ | |
return vsprintf(str_replace('?', '%s', $query->toSql()), collect($query->getBindings())->map(function ($binding) { | |
$binding = addslashes($binding); |
OlderNewer