if ($request->hasFile('image')) {
$image = $request->file('image');
// Will upload to /storage/public/472385852.jpg for example
$destination = 'public/' . time() . "." . $image->getClientOriginalExtension();
Storage::disk('local')->put($destination, file_get_contents($image->getRealPath()));
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 Illuminate\Support\Facades\Route; | |
use Illuminate\Mail\Markdown; | |
use Illuminate\Support\Str; | |
use Illuminate\View\View; | |
class LegalController extends Controller |
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
fab fa-500px | |
fab fa-accessible-icon | |
fab fa-accusoft | |
fab fa-acquisitions-incorporated | |
fas fa-ad | |
fas fa-address-book | |
fas fa-address-card | |
fas fa-adjust | |
fab fa-adn | |
fab fa-adobe |
[]
(por ejemplo, [NOMBRE]
) deben de ser reemplazados por el nombre
de una migración, tabla… Dependiendo de la función del comando que se vaya a utilizar.
Un ejemplo de ello sería el comando php artisan make:model [NOMBRE] -m
. Si se quiere crear un modelo que se llame User
,
se tendría que ejecutar php artisan make:model User -m
.
Otro aspecto a tener en cuenta es que las flags (--seed
, --inline
…) pueden ser combinables, aunque no siempre es así. Por ejemplo, --invokable
y --resource
no se pueden ejecutar en el mismo comando puesto que la acción de cada una entraría en conflicto.
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
# Cheat sheet at https://dockerlabs.collabnix.com/docker/cheatsheet/ | |
# Creates a Docker image on the current directory (must have a Dockerfile) | |
docker build -t $IMAGE_NAME . | |
# Run the recently built image | |
docker run $IMAGE_NAME | |
# Deletes all containers and all images | |
docker container prune && docker image prune -a |
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
#----------------------------------------------------- | |
# For basics, see: https://laracasts.com/series/laravel-from-scratch-2018 | |
#----------------------------------------------------- | |
# Laravel + Lando.dev | |
- lando init | |
- lando laravel new myfirstsite | |
- cd myfirstsite (or move files to the root) | |
- composer require laravel/ui (https://laravel.com/docs/7.x/frontend) |
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
#!/usr/bin/env bash | |
# Check APT | |
echo ============== | |
echo = apt update = | |
echo ============== | |
sudo apt update && sudo apt upgrade -y | |
# Install git | |
echo =============== | |
echo = git install = |
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
//create new | |
composer create-project --prefer-dist laravel/laravel example-app | |
composer create-project laravel/laravel example-app "8.*" | |
php artisan make:controller controller_name | |
php artisan make:model model_name | |
php artisan make:migration migration_name | |
php artisan make:seeder seeder_name | |
php artisan make:middleware middleware_name |
NewerOlder