What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-11-09 01:14:09
laravel model bind with route in model
/** * Retrieve the model for a bound value. * * @param mixed $value * @param string|null $field * @return \Illuminate\Database\Eloquent\Model|null */ public function resolveRouteBinding($value, $field = null) { return $this->where('name',... Add solution -
Other 2021-11-08 12:57:07
laravel collection find
/** in migrations this changes need to add for table we want to add soft delete (LARAVEL)*/ /** The migrations. START */ public function up() { Schema::table('users', function(Blueprint $table) { $table->softDeletes(); }); } /** The ... Add solution -
Other 2021-11-04 02:01:11
Laravel eloquent pruning model
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Prunable; class Flight extends Model { use Prunable; /** * Get the prunable model query. * * @return \Illuminate\Database\El... Add solution -
PHP 2021-10-27 17:20:10
autogenerate slug for model laravel
/** * Laravel provides a boot method which is 'a convenient place to * register your event bindings.' * See: https://laravel.com/docs/master/eloquent#events */ public static function boot() { parent::boot(); // registering a callback to be e... Add solution
Best helpers
Ranking is empty