You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
namespace App;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use \Askedio\SoftCascade\Traits\SoftCascadeTrait;
class User extends Authenticatable
{
use Notifiable, SoftDeletes, SoftCascadeTrait;
protected $softCascade = ['offers'];
public function offers()
{
return $this->hasMany('App\Offer');
}
offer.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Offer extends Model
{
use SoftDeletes;
}
UsersController.php
<?php
namespace App\Http\Controllers;
use App\User;
class UsersController extends Controller
{
public function delete($id)
{
try {
User::where('id', $id)->delete();
} catch (\Exception $e) {
return response()->json([
'message' => $e->getMessage(),
], 403);
}
}
}
@atix9000 What do you want to say with not working? Could you explain better what occurs? @renjithspace As I say to @atix9000 explain better what is happening to you. Also comment to you that the package you pass only work with EloquentBuilder and our package also work with QueryBuilder.
user.php
offer.php
UsersController.php
offers table
The text was updated successfully, but these errors were encountered: