I just updated from Laravel 4.1 to 4.2.7. I am trying to delete with Soft Delete using:
use SoftDeletingTrait; protected $dates = ['deleted_at'];
But this gives the error 'Not Found SoftDeletingTrait Class'. What is the cause of this error?
Just call this by type 'use Illuminate\Database\Eloquent\SoftDeletingTrait;'
use Illuminate\Database\Eloquent\SoftDeletingTrait; class User extends Eloquent { use SoftDeletingTrait; protected $dates = ['deleted_at']; }
=> OR <=
Go to config/app.php & add Alias
For laravel 4
'SoftDeletingTrait' => 'Illuminate\Database\Eloquent\SoftDeletingTrait',
For Laravel 5
'SoftDeletes' => 'Illuminate\Database\Eloquent\SoftDeletes::class'; or use on model or controller file use Illuminate\Database\Eloquent\SoftDeletes;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With