- https://speakerdeck.com/willroth/50-laravel-tricks-in-50-minutes
- https://www.reddit.com/r/laravel/comments/3to60i/50_laravel_tricks/
- 1. Automatic Model Validation
// app/Http/Controllers/DashboardController.php | |
<?php | |
namespace App\Http\Controllers; | |
use App\Models\Visitor; | |
use Illuminate\Support\Facades\DB; | |
class DashboardController extends Controller | |
{ |
<?php | |
namespace App\Http\Livewire; | |
use App\Models\User; | |
use Livewire\Component; | |
class UsersTable extends Component | |
{ | |
public $totalRecords; |
<?php | |
namespace App\Http\Livewire; | |
use App\Product; | |
use Livewire\Component; | |
use Livewire\WithPagination; | |
class Datatable extends Component | |
{ |
<?php | |
namespace App\Http\Livewire; | |
use App\Customer; | |
use Livewire\Component; | |
class Multiform extends Component | |
{ | |
public $name; |
## Delete a remote branch | |
$ git push origin --delete <branch> # Git version 1.7.0 or newer | |
$ git push origin :<branch> # Git versions older than 1.7.0 | |
## Delete a local branch | |
$ git branch --delete <branch> | |
$ git branch -d <branch> # Shorter version | |
$ git branch -D <branch> # Force delete un-merged branches | |
## Delete a local remote-tracking branch |