This file contains 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
//donde se pone la vista se genera una ruta | |
Route::group(['middleware' => 'auth'], function () { | |
Route::get('{view}', function ($view) { | |
try { | |
return view($view); | |
} catch (\Exception $e) { | |
abort(404); | |
} | |
})->where('view', '.*'); |
This file contains 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 | |
public function list(Request $request) | |
{ | |
$filtering = new Collection; | |
Expenditure::with('type', 'concept', 'store') | |
->chunk(200, function ($listExpenditures) use (&$filtering, $request) { | |
if ($request->has('startDateRange') && $request->has('endDateRange')) { | |
$startDate = Carbon::createFromFormat('Y-m-d', $request->input('startDateRange')); |
This file contains 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
{{--*/ $test = 'string_var' /*--}} |
This file contains 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
// phpunit.xml | |
<testsuites> | |
<testsuite name="unit"> | |
<directory>./app/tests/unit/</directory> | |
</testsuite> | |
<testsuite name="integration"> | |
<directory>./app/tests/integration/</directory> | |
</testsuite> | |
</testsuites> |
This file contains 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
// install sqlite | |
// sudo apt-get install sqlite3 | |
// install php extension | |
// sudo apt-get install php5-sqlite | |
// en phpunit.xml | |
<env name="DB_CONNECTION" value="sqlite"> |
This file contains 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 | |
// Colocar en AppServiceProvider o en Provider a gusto | |
Validator::extend('alpha_spaces', function($attribute, $value) | |
{ | |
return preg_match('/^[\pL\s]+$/u', $value); | |
}); |
This file contains 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 | |
// Submit form with data | |
public function test_login_form() | |
{ | |
$this->visit('/login') | |
->submitForm('Log In', ['email' => '[email protected]', 'password' => 'secret']) | |
->see('Welcome!') | |
->onPage('dashboard'); | |
} |
This file contains 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 | |
/** | |
* Averiguar ######, que es la sumatoria de los 12 numeros primos capicúas de | |
* 5 cifras que solo usen 2 digitos, uno par y el otro impar | |
* (ejemplos de estos numeros: 11411, 72727, 78887) | |
*/ | |
function es_primo($numero) | |
{ | |
$divisores = 0; |
This file contains 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 | |
if (!function_exists('formato_fecha')) { | |
function formato_fecha($time = null) | |
{ | |
$dias = ["Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sábado"]; | |
$meses = [ | |
"Enero", | |
"Febrero", | |
"Marzo", |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
OlderNewer