Giter Club home page Giter Club logo

controllers-laravel's Introduction

Laravel

Instalaciones

  • Instalamos gestionador de paquetes de LARAVEL (Si ya lo instalaste NO Volver a instalar):
composer global require laravel/installer
  • Crear nueva app:
laravel new appname
  • Instalar dependencias (Opcional):
composer install
  • Generar un AppKey (Opcional):
php artisan key:generate
  • Run:
php artisan serve

Metodo route('aliasName')

Entre doble moustache podemos agregar las diferentes directivas para que Blade ejecute el comando

<a href="{{ route('about') }}">About</a>

Metodo asset('path')

<img src="{{ asset('assets/img/1.jpg') }}" alt="My card 1" />

Migraciones

  1. CREAR migración
php artisan make:migration create_name_table
  1. SINCRONIZA la base de datos con las migraciones que tengamos en database/migrations
php artisan migrate
  1. REVERTIR LA ULTIMA migración
php artisan migrate:rollback
  1. REVERTIR UNA MIGRACIÓN EN ESPECÍFICO por el número de Lote (BATCH)
php artisan migrate:rollback --batch=2
  1. REVERTIR TODAS las migraciones con un solo comando
php artisan migrate:reset
  1. REVERTIR TODAS LAS MIGRACIONES Y CREAR UNA NUEVA migracion con un solo comando
php artisan migrate:refresh

IMPORTANTE: No se recomienda REVERTIR ya que si tenemos claves foraneas podría dar error. En cambio deberemos crear una ACTUALIZACIÓN de la migración

  1. ACTUALIZACIÓN: Crear actualización de la migración
php artisan make:migration update_name_table

Models

  1. Crear model
php artisan make:model Name

Crear modelo con respecto a la migracion

php artisan make:model Name --migration

Controllers

  1. Crear un controlador (Upper Camel Case)
php artisan make:controller NameController

Eloquent ORM

controllers-laravel's People

Contributors

codewithleader avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.