소프트델테 라라벨

코드 예제

8
0

라라벨 충진 가능

    /**
     * The attributes that are mass assignable.
     */
    protected $fillable = [
      					   'title',
                           'slug',
                           'body',
                           'image',
                           'published',
                           'comments_open'
                          ];
5
0

laravel delete where

DB::table('users')->where('id', $id)->delete();
3
0

소프트델레테스 라라벨

class Clientes extends Model{    use SoftDeletes;    protected $dates = ['deleted_at'];}
2
0

라라브 소프트 삭제

Schema::table('flights', function (Blueprint $table) {
    $table->softDeletes();
});
2
0

라라벨 소프트 삭제

/** 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 migrations. END */

	/** after adding softdelete you need to
    point that column in table related model (LARAVEL)*/

	/** The Model. START */
  	use Illuminate\Database\Eloquent\SoftDeletes;
  	class User extends Model {
	  use SoftDeletes;
	  protected $dates = ['deleted_at'];
	}
	/** The Model. END */
1
0

laravel 복원 소프트 삭제

Post::withTrashed()->find($post_id)->restore();

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................