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\User; | |
use Illuminate\Http\Request; | |
class UserController extends Controller | |
{ | |
public function 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
@extends('layouts.app') | |
@section('content') | |
<table class="table"> | |
<tr> | |
<th>Name</th> | |
<th>Email</th> | |
</tr> | |
@foreach ($users as $user) |
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
var app = { | |
init() { | |
this.createScene(); | |
}, | |
createScene() { | |
this.scene = new BABYLON.Scene(this.engine); | |
this.scene.clearColor = new BABYLON.Color4(0, 0, 0, 0); |
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 | |
// Código mais simples gerada pela restruturação, focada na simplicidade | |
$currentLabels = $this->getCurrentLabels(); | |
$labels = Label::where('company_id', $company->id) | |
->whereNotIn('labels.id', $currentLabels); |
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 | |
// Código complexo gerado pela falta de simplicidade na estrutura | |
$labels = DB::table('labelables') | |
->select(['labelables.*', 'labels.id as label_id', 'labels.slug', 'labels.title']) | |
->join('labels', 'labels.id', 'labelables.label_id') | |
->where('labels.title', 'like', '%'.$search.'%') | |
->where('labelables.labelable_type', $request->labelable_type) | |
->whereRaw('(SELECT count(id) | |
FROM labelables AS count_labelables |
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 | |
$collection = collect(['um', 'dois', 'tres', 'quatro', 'cinco']); |
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
class Monster { | |
// ... | |
moveAwayFromPlayer() { | |
this.statuses.CLOSE_TO_PLAYER = false; | |
this.level.interpolate(this, 'distanceBeetweenPlayer', 1.5, 1500); | |
} | |
// ... more methods here | |
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 | |
public function project() | |
{ | |
return $this->belongsTo(Project::class, 'commentable_id', 'id'); | |
} | |
public function task() | |
{ | |
return $this->belongsTo(Task::class, 'commentable_id', 'id'); | |
} |
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 | |
public function getTaskAttribute() | |
{ | |
if($this->commentable_type == 'App\Task') return $this->commentable; | |
return null; | |
} | |
public function getProjectAttribute() | |
{ |
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
import View from '../base/View.js'; | |
export default class TextView extends View { | |
init() { | |
this.setElement('text-editor'); | |
this.setData({'mode': 'insert'}); | |
} | |
initElements() { |