Menu

## StudentController extends Controller
in package
uses RegisterUser, MemberProcess, LogActivity, Common

StudentController.php : 32

### Table of Contents

#### Methods

AddAlumni() : User
  Create or fetch an alumni user and seed profile data.
AlumniFilter() : AnonymousResourceCollection
  Filter alumni users by name alphabet and batch.
AlumniProfileFilter() : AnonymousResourceCollection
  Filter alumni profiles excluding the current user.
blockedstudents() : mixed
create() : Response
  Show the form for creating a new resource.
CreateAlumni() : mixed
  Create an alumni profile record for an existing user.
CreateMark() : Mark|Mark
  Create or update a mark entry for a student exam.
CreateParent() : User
  Create a parent user and link to a student.
CreateTeacher() : User
  Create a teacher user with profile and teacher-specific attributes.
CreateUser() : User
  Create a new student user with profile and academic details.
destroy() : mixed
doActivityLog() : mixed
  Fetches the activities of the logged in users.
edit() : Response
  Show the form for editing the specified resource.
editStudent() : Response
  Show the form for editing the specified resource.
editValidationUser() : Response
  Store a newly created resource in storage.
eventImagePath() : string|null
  Resolve default event image path by category.
fileUpload() : string
  Write raw file contents to storage.
find() : mixed
getFilePath() : string
  Get the public URL for a stored file.
getFilePathforDownload() : string
  Get file contents for download optionally from a specific disk.
getRequestIP() : string
  Retrieve the client IP address considering proxies.
index() : mixed
is_admin() : bool
  Determine if a user ID belongs to an admin role (usergroup_id == 3).
LibraryMemberFilter() : AnonymousResourceCollection
  Filter library member records (students) using profile and library data.
LibraryStaffFilter() : AnonymousResourceCollection
  Filter library staff by profile and library card/lending data.
LibraryTeacherFilter() : AnonymousResourceCollection
  Filter library teachers by profile and library card/lending data.
member() : mixed
MemberFilter() : AnonymousResourceCollection
  Filter members (students) by role, status, and optional profile criteria.
ParentFilter() : AnonymousResourceCollection
  Filter parents with active children and optional profile attributes.
putContents() : string
  Save plain contents to storage with public visibility.
putContentsByFilename() : string
  Save a file with a specific filename to storage.
romanToInteger() : int|null
  Convert a Roman numeral string to an integer.
StaffFilter() : AnonymousResourceCollection
  Filter non-teaching staff users by group and optional attributes.
store() : Response
  Store a newly created resource in storage.
TeacherFilter() : AnonymousResourceCollection
  Filter teacher users by role and profile attributes.
unlinkFilePath() : bool
  Delete a file from the S3 disk.
update() : Response
  Update the specified resource in storage.
UpdateParent() : Userprofile
  Update parent profile details and qualifications.
UpdateUser() : Userprofile
  Update an existing student user profile and academic record.
uploadFile() : string
  Upload a file to storage and return its path.
validationUser() : Response
  Store a newly created resource in storage.

### Methods

#### AddAlumni()

RegisterUser.php : 822

Create or fetch an alumni user and seed profile data.

`public AddAlumni(object $data, int $usergroup_id, int $school_id, string $passing_session) : User`

##### Parameters

$data : object

  Request payload with alumni details

$usergroup_id : int

  Alumni role id

$school_id : int

  School identifier

$passing_session : string

  Passing year/batch

##### Return values

User —

Alumni user model

#### AlumniFilter()

MemberProcess.php : 385

Filter alumni users by name alphabet and batch.

`public AlumniFilter(Request $request, int $school_id, int $usergroup_id) : AnonymousResourceCollection`

##### Parameters

$request : Request

  Incoming request with filter params

$school_id : int

  School identifier

$usergroup_id : int

  Alumni role id

##### Return values

AnonymousResourceCollection

#### AlumniProfileFilter()

MemberProcess.php : 425

Filter alumni profiles excluding the current user.

`public AlumniProfileFilter(Request $request, int $school_id, int $usergroup_id, int $user_id) : AnonymousResourceCollection`

##### Parameters

$request : Request

  Incoming request with filter params

$school_id : int

  School identifier

$usergroup_id : int

  Alumni role id

$user_id : int

  Current user id to exclude

##### Return values

AnonymousResourceCollection

#### blockedstudents()

StudentController.php : 371
`public blockedstudents() : mixed`

#### create()

StudentController.php : 94

Show the form for creating a new resource.

`public create() : Response`

##### Return values

Response

#### CreateAlumni()

RegisterUser.php : 900

Create an alumni profile record for an existing user.

`public CreateAlumni(object $data, string $path, int $usergroup_id, int $school_id, User $user) : mixed`

##### Parameters

$data : object

  Alumni profile payload

$path : string

  Photo path

$usergroup_id : int

  Alumni role id

$school_id : int

  School identifier

$user : User

  User to link

##### Return values

mixed —

Persisted alumni profile

#### CreateMark()

RegisterUser.php : 750

Create or update a mark entry for a student exam.

`public CreateMark(object $data, int $school_id, AcademicYear $academic_year, int $sc_grade, int|null $non_sc_grade) : Mark|Mark`

##### Parameters

$data : object

  Payload with mark details and associations

$school_id : int

  School identifier

$academic_year : AcademicYear

  Academic year model

$sc_grade : int

  Scholastic grading scheme id

$non_sc_grade : int|null

  Non-scholastic grading scheme id

##### Return values

Mark|Mark —

Persisted mark model

#### CreateParent()

RegisterUser.php : 357

Create a parent user and link to a student.

`public CreateParent(int|null $student_id, object $data, int $school_id, int $usergroup_id) : User`

##### Parameters

$student_id : int|null

  Student identifier to attach (optional)

$data : object

  Request payload containing parent details

$school_id : int

  School identifier

$usergroup_id : int

  Parent role id

##### Return values

User —

Parent user model

#### CreateTeacher()

RegisterUser.php : 567

Create a teacher user with profile and teacher-specific attributes.

`public CreateTeacher(object $data, int $school_id, AcademicYear $academic_year, string $path, int $usergroup_id) : User`

##### Parameters

$data : object

  Request payload with teacher info

$school_id : int

  School identifier

$academic_year : AcademicYear

  Academic year model

$path : string

  Avatar path if provided

$usergroup_id : int

  Teacher role id

##### Return values

User —

Newly created teacher

#### CreateUser()

RegisterUser.php : 40

Create a new student user with profile and academic details.

`public CreateUser(object $data, int $school_id, int $academic_year_id, string $path, int $usergroup_id) : User`

##### Parameters

$data : object

  Request payload containing user, profile, and academic info

$school_id : int

  School identifier

$academic_year_id : int

  Academic year identifier

$path : string

  Avatar path if available

$usergroup_id : int

  User group id for the student

##### Return values

User —

Newly created user

#### destroy()

StudentController.php : 333
`public destroy(mixed $name) : mixed`

##### Parameters

$name : mixed

#### doActivityLog()

LogActivity.php : 15

Fetches the activities of the logged in users.

`public doActivityLog(string $performed_on, string $caused_by, text $properties, mixed $logname, text $message) : mixed`

##### Parameters

$performed_on : string
$caused_by : string
$properties : text
$logname : mixed
$message : text

#### edit()

StudentController.php : 255

Show the form for editing the specified resource.

`public edit(mixed $name) : Response`

##### Parameters

$name : mixed

##### Return values

Response

#### editStudent()

StudentController.php : 189

Show the form for editing the specified resource.

`public editStudent(mixed $name) : Response`

##### Parameters

$name : mixed

##### Return values

Response

#### editValidationUser()

StudentController.php : 276

Store a newly created resource in storage.

`public editValidationUser(Request $request, mixed $name) : Response`

##### Parameters

$request : Request
$name : mixed

##### Return values

Response

#### 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

#### find()

StudentController.php : 39
`public find(Request $request) : mixed`

##### Parameters

$request : Request

#### 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

#### getRequestIP()

Common.php : 93

Retrieve the client IP address considering proxies.

`public getRequestIP() : string`

##### Return values

string —

IP address

#### index()

StudentController.php : 56
`public index() : mixed`

#### 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

#### LibraryMemberFilter()

MemberProcess.php : 465

Filter library member records (students) using profile and library data.

`public LibraryMemberFilter(Request $request, int $school_id, int $usergroup_id, string $status) : AnonymousResourceCollection`

##### Parameters

$request : Request

  Incoming request with filter params

$school_id : int

  School identifier

$usergroup_id : int

  User group to filter by

$status : string

  Default status filter

##### Return values

AnonymousResourceCollection

#### LibraryStaffFilter()

MemberProcess.php : 631

Filter library staff by profile and library card/lending data.

`public LibraryStaffFilter(Request $request, int $school_id, array<string|int, mixed> $usergroup_id) : AnonymousResourceCollection`

##### Parameters

$request : Request

  Incoming request with filter params

$school_id : int

  School identifier

$usergroup_id : array<string|int, mixed>

  Staff role ids

##### Return values

AnonymousResourceCollection

#### LibraryTeacherFilter()

MemberProcess.php : 557

Filter library teachers by profile and library card/lending data.

`public LibraryTeacherFilter(Request $request, int $school_id, int $usergroup_id) : AnonymousResourceCollection`

##### Parameters

$request : Request

  Incoming request with filter params

$school_id : int

  School identifier

$usergroup_id : int

  Teacher role id

##### Return values

AnonymousResourceCollection

#### member()

StudentController.php : 104
`public member() : mixed`

#### MemberFilter()

MemberProcess.php : 36

Filter members (students) by role, status, and optional profile criteria.

`public MemberFilter(Request $request, int $school_id, int $usergroup_id, string $status) : AnonymousResourceCollection`

##### Parameters

$request : Request

  Incoming request with filter params

$school_id : int

  School identifier

$usergroup_id : int

  User group to filter by

$status : string

  Default status filter

##### Return values

AnonymousResourceCollection

#### ParentFilter()

MemberProcess.php : 310

Filter parents with active children and optional profile attributes.

`public ParentFilter(Request $request, int $school_id, int $usergroup_id) : AnonymousResourceCollection`

##### Parameters

$request : Request

  Incoming request with filter params

$school_id : int

  School identifier

$usergroup_id : int

  Parent role id

##### Return values

AnonymousResourceCollection

#### 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

#### 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

#### StaffFilter()

MemberProcess.php : 224

Filter non-teaching staff users by group and optional attributes.

`public StaffFilter(Request $request, int $school_id, array<string|int, mixed> $usergroup_id) : AnonymousResourceCollection`

##### Parameters

$request : Request

  Incoming request with filter params

$school_id : int

  School identifier

$usergroup_id : array<string|int, mixed>

  One or more staff role ids

##### Return values

AnonymousResourceCollection

#### store()

StudentController.php : 141

Store a newly created resource in storage.

`public store(Request $request) : Response`

##### Parameters

$request : Request

##### Return values

Response

#### TeacherFilter()

MemberProcess.php : 138

Filter teacher users by role and profile attributes.

`public TeacherFilter(Request $request, int $school_id, int $usergroup_id) : AnonymousResourceCollection`

##### Parameters

$request : Request

  Incoming request with filter params

$school_id : int

  School identifier

$usergroup_id : int

  Teacher role id

##### Return values

AnonymousResourceCollection

#### 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

#### update()

StudentController.php : 288

Update the specified resource in storage.

`public update(Request $request, mixed $name) : Response`

##### Parameters

$request : Request
$name : mixed

##### Return values

Response

#### UpdateParent()

RegisterUser.php : 482

Update parent profile details and qualifications.

`public UpdateParent(int $student_id, object $data, int $school_id, int $user_id) : Userprofile`

##### Parameters

$student_id : int

  Associated student id

$data : object

  Request payload containing parent updates

$school_id : int

  School identifier

$user_id : int

  Parent user identifier

##### Return values

Userprofile —

Updated parent profile

#### UpdateUser()

RegisterUser.php : 204

Update an existing student user profile and academic record.

`public UpdateUser(object $data, int $school_id, int $academic_year_id, int $user_id, string $path) : Userprofile`

##### Parameters

$data : object

  Request payload with updated fields

$school_id : int

  School identifier

$academic_year_id : int

  Academic year identifier

$user_id : int

  User identifier to update

$path : string

  Avatar path if replaced

##### Return values

Userprofile —

Updated profile

#### 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

#### validationUser()

StudentController.php : 130

Store a newly created resource in storage.

`public validationUser(Request $request) : Response`

##### Parameters

$request : Request

##### Return values

Response

## Search results