Ad
How To Make A Migration In Laravel Module?
In my Laravel project, I use nwidart package for making modules. Now I want to add deleted_at
column to an existing model. I should make a new migration in my module.
How can I do this?
Here is the package documentation: https://nwidart.com/laravel-modules/v4/advanced-tools/artisan-commands
I want some thing like this for module:
php artisan make:migration add_soft_deletes_to_user_table --table="users"
Ad
Answer
Try this command: php artisan module:make-migration add_soft_deletes_to_users_table
.
Then do not forget to use Illuminate\Database\Eloquent\SoftDeletes
trait on your User
model.
use Illuminate\Database\Eloquent\SoftDeletes;
class User extends Model {
use SoftDeletes;
}
Ad
source: stackoverflow.com
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS - Conditionally Load a Different Page
- → Make a Laravel collection into angular array (octobercms)
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
- → Validating fileupload(image Dimensions) in Backend Octobercms
- → OctoberCMS Fileupload completely destroys my backend
- → How do I call the value from another backed page form and use it on a component in OctoberCms
Ad