Did you get a chance to look into my code?
deben
@deben
Posts made by deben
-
RE: Adding additional user data on User Module
-
RE: Adding additional user data on User Module
Hey,
I got registered user id using UserHasaRegistered event and stored on profile__profiles table. But why the additional fields like about_user,designation are not storing on profile__profiles table. How can I debug this? In the documentation you have specified input name syntax as profile[your-field-name]. Am I doing anything wrong? Following are the two fields on create user view.(from backend new user registration).<div class="form-group{{ $errors->has('profile.designation') ? ' has-error has-feedback' : '' }}"> {!! Form::label('profile[designation]', trans('profile::profiles.form.designation')) !!} <input class="form-control" placeholder="{{ trans('profile::profiles.form.designation') }}" name="profile[designation]" type="text" id="profile[designation]" value="{{ Input::old('profile.designation') }}"> {!! $errors->first('<profile class="designation"></profile>', '<span class="help-block">:message</span>') !!} </div> <div class="form-group{{ $errors->has('profile.about_user') ? ' has-error has-feedback' : '' }}"> {!! Form::label('profile[about_user]', trans('profile::profiles.form.about user')) !!} <textarea cols="20" rows="3" class="form-control" placeholder="{{ trans('profile::profiles.form.about user') }}" name="profile[about_user]" type="text" id="profile[about_user]" value="{{ Input::old('profile.about_user') }}"></textarea> {!! $errors->first('profile.about_user', '<span class="help-block">:message</span>') !!} </div>
-
UserHasRegistered event not working.
Hi there,
I am trying to extends the User module to add extra fields on Create New user page at backend. Along with First name, last name, password,confirm password, I want to add new fields like Designation, About user etc.
So for this I have created one new module called UserProfile. But In my case UseHasRegistered event is not working. While updating users UseWasUpdated event is working perfectly. What could be the issue any guess?
Can you please help me on this issue?
-
RE: Adding additional user data on User Module
Ok Cool, this was working fine for Update users. But when am trying to register new user "UserHasRegistered " event not working. Which event should I used for register new user? Is there any other event ? Can you please try with register new user and check event is working for you or not.
-
RE: Adding additional user data on User Module
Hey,
I tried from scratch installing new asgardcms and create profile module to add extra fields to User Module. But same thing happens ,Event is not working .So can you please give me your working Event Handler file and Providers file for Profile Module.
-
RE: Adding additional user data on User Module
I did try composer dump-autoload but it's not working.
-
RE: Adding additional user data on User Module
Hey,
Once I run- php artisan dump-autoloadI got
[InvalidArgumentException]
Command "dump-autoload" is not defined. -
RE: Adding additional user data on User Module
I had already added . but this was not working.
//This is my module.json file looks like{
"name": "Profile",
"alias": "profile",
"description": "",
"version": "v0.1",
"keywords": [],
"active": 1,
"order": 1,
"providers": [
"Modules\Profile\Providers\ProfileServiceProvider",
"Modules\Profile\Providers\RouteServiceProvider",
"Modules\Profile\Providers\EventServiceProvider"
],
"aliases":{},
"files": []
}
// config/relations.php
<?php
return [
'User' => [
'profile' => function ($self) {
return $self->belongsTo('Modules\Profile\Entities\Profile', 'id', 'user_id')->first();
}
]
];// Profile/Entities/profile.php
<?php namespace Modules\Profile\Entities;
use Dimsav\Translatable\Translatable;
use Illuminate\Database\Eloquent\Model;class Profile extends Model
{
use Translatable;protected $table = 'profile__profiles'; public $translatedAttributes = []; protected $fillable = ['user_id','about_user','designation','profile_img']; public function user() { $driver = config('asgard.user.users.driver'); return $this->belongsTo("Modules\\User\\Entities\\{$driver}\\User"); }
}
-
RE: Adding additional user data on User Module
In the documentation here not specified , how user_id stores on profile__profiles table ? How UserHasRegistered and UserWasUpdated events firing?
Do your needful help on this.