Menu

## ReportsController extends Controller
in package
uses MemberProcess, LogActivity, Common

ReportsController.php : 49

Class ReportsController

Handles all report-related operations such as:

- Holidays import/export
- Events reports
- Subscription reports
- Fee payment exports
- Student and teacher birthday exports
- Student status reports
- Parent reports
- Inventory stock, purchase, and sales reports

### Table of Contents

#### Methods

AlumniFilter() : AnonymousResourceCollection
  Filter alumni users by name alphabet and batch.
AlumniProfileFilter() : AnonymousResourceCollection
  Filter alumni profiles excluding the current user.
create() : View
  Filter subscriptions by date range.
currentstock() : void
  Export current inventory stock as CSV.
doActivityLog() : mixed
  Fetches the activities of the logged in users.
eventImagePath() : string|null
  Resolve default event image path by category.
eventReport() : View
  Display event reminder reports.
exportActiveStudents() : void
  Export active students report as CSV.
exportBirthday() : void
  Export student or teacher birthday list.
exportExitStudents() : void
  Export exited students report as CSV.
exportFee() : void
  Export fee payment details.
exportParent() : void
  Export parent details report as CSV.
exportSuspendedStudents() : void
  Export suspended students report as CSV.
fileUpload() : string
  Write raw file contents to storage.
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.
holidayCreate() : View
  Show holiday import page.
holidayExport() : void
  Export holidays as CSV.
holidayFormat() : void
  Download holiday CSV sample format.
holidayImport() : RedirectResponse|null
  Import holidays from uploaded file.
index() : View
  Display subscription reports.
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.
MemberFilter() : AnonymousResourceCollection
  Filter members (students) by role, status, and optional profile criteria.
monthlypurchase() : void
  Export monthly purchase report as CSV.
monthlysales() : void
  Export monthly sales report as CSV.
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.
report() : View
  Display the reports dashboard.
romanToInteger() : int|null
  Convert a Roman numeral string to an integer.
show() : View
  Show single subscription report.
StaffFilter() : AnonymousResourceCollection
  Filter non-teaching staff users by group and optional attributes.
TeacherFilter() : AnonymousResourceCollection
  Filter teacher users by role and profile attributes.
unlinkFilePath() : bool
  Delete a file from the S3 disk.
uploadFile() : string
  Upload a file to storage and return its path.

### Methods

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

#### create()

ReportsController.php : 233

Filter subscriptions by date range.

`public create(Request $request) : View`

##### Parameters

$request : Request

##### Return values

View

#### currentstock()

ReportsController.php : 717

Export current inventory stock as CSV.

`public currentstock() : void`

Fetches product stock details from inventory module (if available) or from default product model and exports them.

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

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

#### eventReport()

ReportsController.php : 202

Display event reminder reports.

`public eventReport() : View`

##### Return values

View

#### exportActiveStudents()

ReportsController.php : 436

Export active students report as CSV.

`public exportActiveStudents(Request $request) : void`

Filters active students based on request parameters (if provided) and exports their personal and academic details.

##### Parameters

$request : Request

#### exportBirthday()

ReportsController.php : 337

Export student or teacher birthday list.

`public exportBirthday(string $type) : void`

##### Parameters

$type : string

#### exportExitStudents()

ReportsController.php : 505

Export exited students report as CSV.

`public exportExitStudents(Request $request) : void`

Exports students who have exited the school.

##### Parameters

$request : Request

#### exportFee()

ReportsController.php : 269

Export fee payment details.

`public exportFee(Request $request) : void`

##### Parameters

$request : Request

#### exportParent()

ReportsController.php : 639

Export parent details report as CSV.

`public exportParent(Request $request) : void`

##### Parameters

$request : Request

#### exportSuspendedStudents()

ReportsController.php : 572

Export suspended students report as CSV.

`public exportSuspendedStudents(Request $request) : void`

##### Parameters

$request : Request

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

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

#### holidayCreate()

ReportsController.php : 99

Show holiday import page.

`public holidayCreate() : View`

##### Return values

View

#### holidayExport()

ReportsController.php : 150

Export holidays as CSV.

`public holidayExport(Request $request) : void`

##### Parameters

$request : Request

#### holidayFormat()

ReportsController.php : 74

Download holiday CSV sample format.

`public holidayFormat() : void`

#### holidayImport()

ReportsController.php : 110

Import holidays from uploaded file.

`public holidayImport(Request $request) : RedirectResponse|null`

##### Parameters

$request : Request

##### Return values

RedirectResponse|null

#### index()

ReportsController.php : 215

Display subscription reports.

`public index() : View`

##### Return values

View

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

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

#### monthlypurchase()

ReportsController.php : 780

Export monthly purchase report as CSV.

`public monthlypurchase(Request $request) : void`

Generates purchase report for the given month and year. Defaults to current month if not provided.

##### Parameters

$request : Request

#### monthlysales()

ReportsController.php : 861

Export monthly sales report as CSV.

`public monthlysales(Request $request) : void`

Generates sales report for the selected month and year. Defaults to current month if parameters are missing.

##### Parameters

$request : Request

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

#### report()

ReportsController.php : 61

Display the reports dashboard.

`public report(Request $request) : View`

##### Parameters

$request : Request

##### Return values

View

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

#### show()

ReportsController.php : 250

Show single subscription report.

`public show(int $id) : View`

##### Parameters

$id : int

##### Return values

View

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

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

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

## Search results