Skip to content

Instantly share code, notes, and snippets.

View phreakin's full-sized avatar

Phreakin phreakin

View GitHub Profile
@webrobert
webrobert / LegalController.php
Last active December 4, 2022 23:12
A markdown driven Legal pages for my Laravel sites.
<?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
@itsdonnix
itsdonnix / laravel_cheatsheets.md
Last active December 4, 2022 23:09
Laravel Cheatsheets

Laravel Cheatsheets

Laravel Upload file to storage folder (local)

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')-&gt;put($destination, file_get_contents($image-&gt;getRealPath()));
@cristianstan
cristianstan / FontAwesome 5 all icons in list.txt
Last active June 15, 2023 04:33
FontAwesome 5 cheatsheet all icons in PHP array.php
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
@HenestrosaDev
HenestrosaDev / artisan-cheatsheet.md
Last active March 8, 2025 21:49
Laravel PHP Artisan cheatsheet en español

PHP ARTISAN CHEATSHEET EN ESPAÑOL

IMPORTANTE

Aquellos trozos de código que estén comprendidos entre [] (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.

@tomasdev
tomasdev / commands.sh
Last active December 4, 2022 22:50
Useful Docker commands
# 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
#-----------------------------------------------------
# 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)
@JuenTingShie
JuenTingShie / run.sh
Last active December 4, 2022 22:48
My brand-new linux startup
#!/usr/bin/env bash
# Check APT
echo ==============
echo = apt update =
echo ==============
sudo apt update && sudo apt upgrade -y
# Install git
echo ===============
echo = git install =
@drewyangdev
drewyangdev / mysql_cheatsheet.md
Last active September 21, 2023 20:22
MySQL-note

MySQL Cheatsheet

-- Drew Yang @ DataJoint


Useful MySQL CMD/shell tools

# show wide results
SELECT * FROM table\G;
//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