Skip to content

Instantly share code, notes, and snippets.

View blogui91's full-sized avatar
🎯
Focusing

Cesar Santana blogui91

🎯
Focusing
  • Doorvel
  • Monterrey
  • 22:16 (UTC -06:00)
View GitHub Profile
@blogui91
blogui91 / CRUDController.php
Last active June 21, 2017 15:31
CRUD Base Controller
<?php
namespace App\Http\Controllers;
class CRUDController extends Controller
{
protected $repository;
protected $results_per_page = 50;
@blogui91
blogui91 / NestedCRUDController.php
Created June 21, 2017 15:26
NestedCRUD Controller
<?php
namespace App\Http\Controllers;
class NestedCRUDController extends Controller
{
protected $repository;
protected $foreign_key;
@blogui91
blogui91 / ConfiguraProyectoLaravelServidor.md
Created August 30, 2017 18:41
Preparar Servidor NGINX, SERVER UBUNTU
  1. git init
  2. git remote add origin git@bitbucket.org:indexreynosa/website.git
  3. git pull origin master
  4. git branch --set-upstream-to=origin/master //Para que solo tenga que hacer git pull despues y no se muestren como modificados lso archivos
  5. composer install
  6. cp .env.example .env
  7. php artisan key:generate
  8. chown -R www-data.www-data /var/www/heddiefranco.com

Nota: primero generar las ssh keys en el servidor ssh-keygen -t rsa y luego agregarlas a mi cuenta de bitbucket https://bitbucket.org/account/user/HFranco_/ssh-keys/

@blogui91
blogui91 / bootstrap.index.js
Created September 10, 2017 00:40
Bootstrap file
export default
{
install(Vue, options){
Vue.mixin({
mounted(){
console.log("Bootstrapping")
}
})
}
}
@blogui91
blogui91 / config.auth.js
Last active October 21, 2017 15:14
Settings for authetications
export const STATUS = 'local';
let secrets = {
API_LOCAL : 'mysecretinlocal',
API_DEV : 'mysecretindev',
API_PRODUCTION : 'mysecretinproduction'
}
export const BASE_URL = {
'local' : 'http://localhost:8000/',
@blogui91
blogui91 / oauth.index.js
Last active September 10, 2017 04:37
Class Auth
/***************************************************
* [Quasar Cookies] http://quasar-framework.org/components/cookies.html
* [Quasar LocalStorage] http://quasar-framework.org/components/web-storage.html
**************************************************/
import { Cookies, LocalStorage } from 'quasar'
import AuthService from './auth.service'
@blogui91
blogui91 / bootstrap-v2.index.js
Created September 10, 2017 15:19
Injecting OAuth as helper
import OAuth from 'oauth'
export default
{
install(Vue, options){
//In this way we'll expose our class in all Vue components
Vue.prototype.$oauth = new OAuth();
Vue.mixin({
mounted(){
@blogui91
blogui91 / oauth.service.js
Last active September 12, 2017 04:00
Service for OAuth class
import Http from 'axios'
import API from 'api/routes' // We create a file to store all the endpoints
export default {
user : null,
destroySession(){
this.user = null
},
async currentUser(){
if(this.user) {
return this.user
@blogui91
blogui91 / api.routes.js
Last active September 10, 2017 21:45
We declare here all our routes for the application
import {
BASE_TOKEN,
API_URL,
} from 'config/auth'
export default {
TOKEN_URL: BASE_TOKEN + 'oauth/token',
CURRENT_USER_URL : API_URL + "users/user",
endpoints: {
<template>
<div class="login-view layout-padding">
<q-card class="bg-white card" inline>
<q-card-title>
<h3>Login</h3>
<span slot="subtitle"></span>
</q-card-title>
<q-card-main>
<form @submit.prevent="login">
<q-input v-model="form.username" stack-label="Email" />