Skip to content

Instantly share code, notes, and snippets.

View EhtuCom's full-sized avatar

ehtu.com - David Lyons EhtuCom

View GitHub Profile
@EhtuCom
EhtuCom / Command line Laravel Migrations Basics
Last active October 30, 2021 06:51
Laravel Eloquent Migrations Models Database Cheat Sheet by Ehtu.com
php artisan make:migration create_users_table --create=users
php artisan make:migration add_votes_to_users_table --table=users
...
php artisan migrate
php artisan migrate:rollback
php artisan migrate:rollback --step=5
TO CAMEL CASE MODEL: model_name "_" characteer becomes uppercase
<a wire:click="$set('vote', 1)">Set var value</a>
<a wire:click.prevent="$toogle('booleanval')">Toggle boolean</a>
<div wire:offline>Show this when user offline</div>
<!-- simple input text: -->
<input type='text' wire:model.debounce.2s .500ms="name">
<!-- button confirm and event prevent: -->
<button wire:click.prevent="delete({{ $product->id }})" onclick="confirm('Are you sure') || event.stopImmediatePropagation()">
Delete
</button>