One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
<?php | |
function utf8_encode_deep(&$input) { | |
if (is_string($input)) { | |
$input = utf8_encode($input); | |
} else if (is_array($input)) { | |
foreach ($input as &$value) { | |
utf8_encode_deep($value); | |
} | |
unset($value); |
/** | |
* Mass (bulk) insert or update on duplicate for Laravel 4/5 | |
* | |
* insertOrUpdate([ | |
* ['id'=>1,'value'=>10], | |
* ['id'=>2,'value'=>60] | |
* ]); | |
* | |
* | |
* @param array $rows |
<?php | |
namespace App\Helpers; | |
class NamespaceHelper | |
{ | |
/** | |
* Get the namespace of a class. | |
* | |
* @param string $className |
<?php | |
/** | |
* Gera a paginação dos itens de um array ou collection. | |
* | |
* @param array|Collection $items | |
* @param int $perPage | |
* @param int $page | |
* @param array $options | |
* | |
* @return LengthAwarePaginator |
<?php | |
namespace App\Providers; | |
use Illuminate\Support\Collection; | |
use Illuminate\Pagination\LengthAwarePaginator; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
public function boot() |
<?php | |
public function replicateWithRelations(QuestionCategory $questioncategory) | |
{ | |
$newCategory = $questioncategory->replicate(); | |
$newCategory->name = "Kopyası: ".$questioncategory->name; | |
$newCategory->push(); | |
$questioncategory->relations = []; | |
//load relations on EXISTING MODEL |
import 'package:flutter/material.dart'; | |
const String words1 = "Almost before we knew it, we had left the ground."; | |
const String words2 = "A shining crescent far beneath the flying vessel."; | |
const String words3 = "A red flair silhouetted the jagged edge of a wing."; | |
const String words4 = "Mist enveloped the ship three hours out from port."; | |
void main() { | |
runApp(new MyApp()); | |
} |
<?php | |
// This can be found in the Symfony\Component\HttpFoundation\Response class | |
const HTTP_CONTINUE = 100; | |
const HTTP_SWITCHING_PROTOCOLS = 101; | |
const HTTP_PROCESSING = 102; // RFC2518 | |
const HTTP_OK = 200; | |
const HTTP_CREATED = 201; | |
const HTTP_ACCEPTED = 202; |
<?php | |
function transfer($fromAccountId, $toAccountId, $amount) | |
{ | |
DB::beginTransaction(); | |
try { | |
$fromQuery = Account::whereId($fromAccountId); | |
if (! $fromQuery->exists()) { | |
throw new InvalidAccountException(); |