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 | |
namespace M2Digital\Extras\Html; | |
use Illuminate\Contracts\Routing\UrlGenerator; | |
use Illuminate\Html\FormBuilder as IlluminateFormBuilder; | |
class FormBuilder extends IlluminateFormBuilder { |
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
function slugify(str) { | |
str = str.toString().toLowerCase().trim() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/&/g, '-and-') // Replace & with 'and' | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-'); // Replace multiple - with single - | |
return str; | |
} |
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
DROP IF EXISTS TABLE [tmp_table_name]; | |
CREATE TABLE [tmp_table_name] engine=innodb (select * from [reference_table] where ...); | |
SELECT | |
TABLE_NAME AS `Table`, | |
ROUND(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` | |
FROM | |
INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '[schema]' AND TABLE_NAME = '[tmp_table_name]'; |
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 | |
namespace App\Commands; | |
use Illuminate\Console\Command; | |
class DescTableCommand extends Command | |
{ | |
/** | |
* The name and signature of the console command. |
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 | |
namespace App\Http\Controllers; | |
use App\Http\Controllers\Controller; | |
class AplicacaoController extends Controller | |
{ | |
private $session; | |
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 | |
/** | |
* Handle an incoming request. | |
* | |
* @param \Illuminate\Http\Request $request | |
* @param \Closure $next | |
* @return mixed | |
* | |
*/ | |
public function handle($request, Closure $next) |
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 | |
namespace App\Commands\Database; | |
use Illuminate\Support\ServiceProvider; | |
class BindDatabaseServiceProvider extends ServiceProvider | |
{ | |
public function boot() | |
{ |
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
input { | |
file { | |
path => "/data/logs/laravel/laravel.log" | |
start_position => "beginning" | |
type => "laravel_core_log" | |
codec => multiline { | |
pattern => "^\[" | |
what => "previous" | |
negate => true | |
} |
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 | |
# Ex 2 | |
use App\Applications\Backend\Http\Controllers\ExampleController; | |
Route::get('/{locale}/hackaton', function (\Illuminate\Http\Request $request) { | |
App::setLocale($request->locale); | |
return app(ExampleController::class)->callAction('index', []); | |
}); |
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 | |
namespace App; | |
class CacheProductRepository extends ProductInterface | |
{ | |
public function getAll() | |
{ | |
// Get all products from redis... | |
} |
OlderNewer