Skip to content

Instantly share code, notes, and snippets.

View ffmit's full-sized avatar
🎯
Focusing

ffmit

🎯
Focusing
View GitHub Profile
@ffmit
ffmit / Laravel.md
Last active April 3, 2023 16:39
Laravel - Frequently used commands

Laravel - Standard tasks for a new project

Mac: Prerequisites

Mac: Node / Install or update

Mac: Update Node

Mac: n needs to be installed

npm install -g n

@ffmit
ffmit / laravel_view_migration.php
Last active November 9, 2019 21:14
Laravel - Add view with migration
public function up()
{
// Delete the view in case of "php artisan:fresh", to workaround bug
DB::statement('DROP VIEW IF EXISTS userItemlistsView');
// Create views
DB::statement("CREATE VIEW userItemlistsView AS
SELECT
U.NAME AS USER_NAME,
I.NAME AS LIST_NAME
FROM

/**

  • @param string $argument1 This is the description. */

Laravel

Pragmatic phpDoc blocks

Standard Function

/**
@ffmit
ffmit / clear_laravel.txt
Created October 24, 2019 11:17
Clear all caches in Laravel
php artisan route:clear && php artisan view:clear && php artisan config:clear && php artisan cache:clear
@ffmit
ffmit / bulma_color_palette_scheme.txt
Created October 11, 2019 11:37
bulma color palette scheme
Official Bulma colors and those which suite very nicely:
Box background for Chart.js canvas: #f6f8fa
@ffmit
ffmit / laravel_todo_order
Created October 4, 2019 08:39
Laravel Todo Order
Adjust timezone via app.php to read from .env file
@ffmit
ffmit / laravel_flash_messaging.txt
Last active October 3, 2019 16:09
Laravel Flash Messaging
Please note:
Flash messages are made with Bulma (https://bulma.io)
Write in Controller
-------------------
request()->session()->flash('success', 'This is a success.');
OR
@ffmit
ffmit / laravel_routes_samples
Created September 30, 2019 15:33
Laravel Routes
// Named route for "About us" page which is placed in "/resources/views/other" folder
Route::get('/about', ['as' => 'about', function () {
return view('other.about');
}]);
// Resourceful route
Route::resource('entries', 'EntryController');
@ffmit
ffmit / laravel_plural_vs_singular
Last active September 27, 2019 07:30
Laravel - Plural vs. Singular
Model ------- Singular -- (e.g. app/Car.php)
Controller -- Singular -- (e.g. app/Http/Controllers/CarController.php)
Table ------- Plural ---- (e.g. "cars")
Factory ----- Singular -- (e.g. database/factories/CarFactory.php)
Seed -------- Plural ---- (e.g. database/seeds/CarsTableSeeder.php)
PivotTable -- Singular -- (e.g. car_dealer, for a connection between cars and dealers tables)
<!DOCTYPE html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../../resources/css/bulma.css">
<link rel="stylesheet" href="../../resources/css/custom.css">
<script src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
<script>