Menu

## Userprofile extends Model
in package
uses PresentableTrait, SoftDeletes, Common, HasFactory

Userprofile.php : 59

Class Userprofile

Model for managing user profile information.

##### Tags

mixin

### Table of Contents

#### Properties

$aadhar_number : string
$address : string
$alternate_no : string
$avatar : string
$avatarPath : string
$birth_place : string
$blood_group : string
$caste : string
$city : City
$city_id : int
$country : Country
$country_id : int
$created_at : DateTime
$date_of_birth : DateTime
$deleted_at : DateTime
$EMIS_number : string
$firstname : string
$gender : string
$id : int
$joining_date : DateTime
$lastname : string
$marital_status : string
$mother_tongue : string
$native_place : string
$notes : string
$pincode : string
$qualification : Qualification
$registration_number : string
$relation : string
$school : School
$school_id : int
$state : State
$state_id : int
$status : int
$updated_at : DateTime
$user : User
$user_id : int
$usergroup : Usergroup
$usergroup_id : int
$dates : array<string|int, mixed>
  The attributes that should be mutated to dates.
$fillable : array<string|int, mixed>
  The attributes that are mass assignable.
$presenter : mixed
$table : string
  The table associated with the model.

#### Methods

city() : BelongsTo
  Get the city for this user.
country() : BelongsTo
  Get the country for this user.
eventImagePath() : string|null
  Resolve default event image path by category.
fileUpload() : string
  Write raw file contents to storage.
getAvatarPathAttribute() : string|null
  Get the avatar file path for this user.
getFilePath() : string
  Get the public URL for a stored file.
getFilePathforDownload() : string
  Get file contents for download optionally from a specific disk.
getFirstNameAttribute() : string
  Get uppercase first name.
getLastNameAttribute() : string
  Get uppercase last name.
getRequestIP() : string
  Retrieve the client IP address considering proxies.
is_admin() : bool
  Determine if a user ID belongs to an admin role (usergroup_id == 3).
putContents() : string
  Save plain contents to storage with public visibility.
putContentsByFilename() : string
  Save a file with a specific filename to storage.
qualification() : BelongsTo
  Get the qualification for this user.
romanToInteger() : int|null
  Convert a Roman numeral string to an integer.
school() : BelongsTo
  Get the school for this user.
scopeByRole() : Builder
  Scope to filter by user role/group.
scopeBySchool() : Builder
  Scope to filter by school.
state() : BelongsTo
  Get the state for this user.
unlinkFilePath() : bool
  Delete a file from the S3 disk.
uploadFile() : string
  Upload a file to storage and return its path.
user() : BelongsTo
  Get the user for this profile.
usergroup() : BelongsTo
  Get the usergroup for this profile.

### Properties

#### $aadhar_number

Userprofile.php : 0
`public string $aadhar_number`

#### $address

Userprofile.php : 0
`public string $address`

#### $alternate_no

Userprofile.php : 0
`public string $alternate_no`

#### $avatar

Userprofile.php : 0
`public string $avatar`

#### $avatarPath

Userprofile.php : 0
`public string $avatarPath`

#### $birth_place

Userprofile.php : 0
`public string $birth_place`

#### $blood_group

Userprofile.php : 0
`public string $blood_group`

#### $caste

Userprofile.php : 0
`public string $caste`

#### $city read-only

Userprofile.php : 0
`public City $city`

#### $city_id

Userprofile.php : 0
`public int $city_id`

#### $country read-only

Userprofile.php : 0
`public Country $country`

#### $country_id

Userprofile.php : 0
`public int $country_id`

#### $created_at

Userprofile.php : 0
`public DateTime $created_at`

#### $date_of_birth

Userprofile.php : 0
`public DateTime $date_of_birth`

#### $deleted_at

Userprofile.php : 0
`public DateTime $deleted_at`

#### $EMIS_number

Userprofile.php : 0
`public string $EMIS_number`

#### $firstname

Userprofile.php : 0
`public string $firstname`

#### $gender

Userprofile.php : 0
`public string $gender`

#### $id

Userprofile.php : 0
`public int $id`

#### $joining_date

Userprofile.php : 0
`public DateTime $joining_date`

#### $lastname

Userprofile.php : 0
`public string $lastname`

#### $marital_status

Userprofile.php : 0
`public string $marital_status`

#### $mother_tongue

Userprofile.php : 0
`public string $mother_tongue`

#### $native_place

Userprofile.php : 0
`public string $native_place`

#### $notes

Userprofile.php : 0
`public string $notes`

#### $pincode

Userprofile.php : 0
`public string $pincode`

#### $qualification read-only

Userprofile.php : 0
`public Qualification $qualification`

#### $registration_number

Userprofile.php : 0
`public string $registration_number`

#### $relation

Userprofile.php : 0
`public string $relation`

#### $school read-only

Userprofile.php : 0
`public School $school`

#### $school_id

Userprofile.php : 0
`public int $school_id`

#### $state read-only

Userprofile.php : 0
`public State $state`

#### $state_id

Userprofile.php : 0
`public int $state_id`

#### $status

Userprofile.php : 0
`public int $status`

#### $updated_at

Userprofile.php : 0
`public DateTime $updated_at`

#### $user read-only

Userprofile.php : 0
`public User $user`

#### $user_id

Userprofile.php : 0
`public int $user_id`

#### $usergroup read-only

Userprofile.php : 0
`public Usergroup $usergroup`

#### $usergroup_id

Userprofile.php : 0
`public int $usergroup_id`

#### $dates

Userprofile.php : 72

The attributes that should be mutated to dates.

`protected array<string|int, mixed> $dates = ['date_of_birth', 'joining_date', 'deleted_at']`

#### $fillable

Userprofile.php : 86

The attributes that are mass assignable.

`protected array<string|int, mixed> $fillable = ['school_id', 'user_id', 'usergroup_id', 'firstname', 'lastname', 'alternate_no', 'gender', 'date_of_birth', 'blood_group', 'birth_place', 'native_place', 'mother_tongue', 'caste', 'address', 'city_id', 'state_id', 'country_id', 'pincode', 'relation', 'aadhar_number', 'registration_number', 'EMIS_number', 'joining_date', 'notes', 'avatar', 'marital_status', 'status']`

#### $presenter

Userprofile.php : 62
`protected mixed $presenter = "App\\Presenters\\UserprofilePresenter"`

#### $table

Userprofile.php : 79

The table associated with the model.

`protected string $table = 'userprofiles'`

### Methods

#### city()

Userprofile.php : 177

Get the city for this user.

`public city() : BelongsTo`

##### Return values

BelongsTo

#### country()

Userprofile.php : 157

Get the country for this user.

`public country() : BelongsTo`

##### Return values

BelongsTo

#### eventImagePath()

Common.php : 118

Resolve default event image path by category.

`public eventImagePath(string $category, string $image) : string|null`

##### Parameters

$category : string

  Event category slug

$image : string

  Unused parameter kept for compatibility

##### Return values

string|null —

Public URL for the event image or null on failure

#### fileUpload()

Common.php : 71

Write raw file contents to storage.

`public fileUpload(string $folder, string $file) : string`

##### Parameters

$folder : string

  Target path (including filename)

$file : string

  Raw file contents

##### Return values

string —

Storage path of the written file

#### getAvatarPathAttribute()

Userprofile.php : 213

Get the avatar file path for this user.

`public getAvatarPathAttribute() : string|null`

##### Return values

string|null

#### getFilePath()

Common.php : 24

Get the public URL for a stored file.

`public getFilePath(string $file) : string`

##### Parameters

$file : string

  Storage path

##### Return values

string —

Publicly accessible URL or empty string on failure

#### getFilePathforDownload()

Common.php : 253

Get file contents for download optionally from a specific disk.

`public getFilePathforDownload([string $disk = '' ], string $file) : string`

##### Parameters

$disk : string = ''

  Storage disk name

$file : string

  File path

##### Return values

string —

File contents

#### getFirstNameAttribute()

Userprofile.php : 96

Get uppercase first name.

`public getFirstNameAttribute(string $value) : string`

##### Parameters

$value : string

##### Return values

string

#### getLastNameAttribute()

Userprofile.php : 107

Get uppercase last name.

`public getLastNameAttribute(string $value) : string`

##### Parameters

$value : string

##### Return values

string

#### getRequestIP()

Common.php : 93

Retrieve the client IP address considering proxies.

`public getRequestIP() : string`

##### Return values

string —

IP address

#### is_admin()

Common.php : 304

Determine if a user ID belongs to an admin role (usergroup_id == 3).

`public static is_admin(int|string $userid) : bool`

##### Parameters

$userid : int|string

  User identifier

##### Return values

bool —

True if user is admin, false otherwise

#### putContents()

Common.php : 157

Save plain contents to storage with public visibility.

`public putContents(string $folder, string $contents) : string`

##### Parameters

$folder : string

  Destination path

$contents : string

  File contents

##### Return values

string —

Storage path of the saved file

#### putContentsByFilename()

Common.php : 182

Save a file with a specific filename to storage.

`public putContentsByFilename(string $folder, UploadedFile $contents, string $filename) : string`

##### Parameters

$folder : string

  Destination folder

$contents : UploadedFile

  File instance

$filename : string

  Target filename

##### Return values

string —

Storage path of the saved file

#### qualification()

Userprofile.php : 147

Get the qualification for this user.

`public qualification() : BelongsTo`

##### Return values

BelongsTo

#### romanToInteger()

Common.php : 205

Convert a Roman numeral string to an integer.

`public romanToInteger(string $roman) : int|null`

##### Parameters

$roman : string

  Roman numeral value

##### Return values

int|null —

Converted integer or null on failure

#### school()

Userprofile.php : 117

Get the school for this user.

`public school() : BelongsTo`

##### Return values

BelongsTo

#### scopeByRole()

Userprofile.php : 202

Scope to filter by user role/group.

`public scopeByRole(Builder $query, int $usergroup_id) : Builder`

##### Parameters

$query : Builder
$usergroup_id : int

##### Return values

Builder

#### scopeBySchool()

Userprofile.php : 189

Scope to filter by school.

`public scopeBySchool(Builder $query, int $school_id) : Builder`

##### Parameters

$query : Builder
$school_id : int

##### Return values

Builder

#### state()

Userprofile.php : 167

Get the state for this user.

`public state() : BelongsTo`

##### Return values

BelongsTo

#### unlinkFilePath()

Common.php : 282

Delete a file from the S3 disk.

`public unlinkFilePath(string $file) : bool`

##### Parameters

$file : string

  File path on S3

##### Return values

bool —

True after attempting deletion

#### uploadFile()

Common.php : 47

Upload a file to storage and return its path.

`public uploadFile(string $folder, UploadedFile $file) : string`

##### Parameters

$folder : string

  Target folder path

$file : UploadedFile

  File to upload

##### Return values

string —

Storage path for the uploaded file

#### user()

Userprofile.php : 127

Get the user for this profile.

`public user() : BelongsTo`

##### Return values

BelongsTo

#### usergroup()

Userprofile.php : 137

Get the usergroup for this profile.

`public usergroup() : BelongsTo`

##### Return values

BelongsTo

## Search results