Updated docblocks

This commit is contained in:
snipe 2016-04-07 13:21:09 -07:00
parent 95e4845176
commit a62859dc6d
36 changed files with 435 additions and 318 deletions

View file

@ -1,13 +1,4 @@
<?php
/**
* This controller handles all actions related to Accessories for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use App\Helpers\Helper;
@ -29,7 +20,10 @@ use Auth;
use Request;
/**
* This class controls all actions related to accessories
* This controller handles all actions related to Accessories for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class AccessoriesController extends Controller
{

View file

@ -1,13 +1,4 @@
<?php
/**
* This controller handles all actions related to Asset Maintenance for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v2.0
*/
namespace App\Http\Controllers;
use App\Models\AssetMaintenance;
@ -30,6 +21,12 @@ use App\Models\Setting;
use App\Models\Asset;
use App\Helpers\Helper;
/**
* This controller handles all actions related to Asset Maintenance for
* the Snipe-IT Asset Management application.
*
* @version v2.0
*/
class AssetMaintenancesController extends Controller
{

View file

@ -1,12 +1,4 @@
<?php
/**
* This controller handles all actions related to Asset Models for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use Image;
@ -30,7 +22,11 @@ use App\Helpers\Helper;
use Symfony\Component\HttpFoundation\JsonResponse;
/**
* This class controls all actions related to asset models
* This class controls all actions related to asset models for
* the Snipe-IT Asset Management application.
*
* @version v1.0
* @author [A. Gianotto] [<snipe@snipe.net>]
*/
class AssetModelsController extends Controller
{

View file

@ -1,13 +1,4 @@
<?php
/**
* This controller handles all actions related to Assets for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use App\Helpers\Helper;
@ -50,7 +41,11 @@ use TCPDF;
use View;
/**
* This class controls all actions related to assets
* This class controls all actions related to assets for
* the Snipe-IT Asset Management application.
*
* @version v1.0
* @author [A. Gianotto] [<snipe@snipe.net>]
*/
class AssetsController extends Controller
{

View file

@ -15,18 +15,16 @@ use Redirect;
use Log;
use View;
/**
* This controller handles authentication for the user, including local
* database users and LDAP users.
*
* @todo Move LDAP methods into user model for better separation of concerns.
* @author [A. Gianotto] [<snipe@snipe.net>]
* @version v1.0
*/
class AuthController extends Controller
{
/*
|--------------------------------------------------------------------------
| Registration & Login Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users, as well as the
| authentication of existing users. By default, this controller uses
| a simple trait to add these behaviors. Why don't you explore it?
|
*/
use ThrottlesLogins;

View file

@ -5,6 +5,14 @@ namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
/**
* This controller handles password resets for the user.
* It uses the built-in Laravel magic of ResetsPasswords, so we
* don't actually do much here.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @version v1.0
*/
class PasswordController extends Controller
{
/*

View file

@ -1,12 +1,4 @@
<?php
/**
* This controller handles all actions related to Asset Categories for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use App\Helpers\Helper;
@ -21,6 +13,13 @@ use Redirect;
use Str;
use View;
/**
* This class controls all actions related to Categories for
* the Snipe-IT Asset Management application.
*
* @version v1.0
* @author [A. Gianotto] [<snipe@snipe.net>]
*/
class CategoriesController extends Controller
{

View file

@ -1,13 +1,5 @@
<?php
/**
* This controller handles all actions related to Company support for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v2.0
*/
namespace App\Http\Controllers;
namespace App\Http\Controllers;
use App\Models\Company;
use Input;
@ -15,6 +7,13 @@ use Lang;
use Redirect;
use View;
/**
* This controller handles all actions related to Companies for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
final class CompaniesController extends Controller
{

View file

@ -1,13 +1,5 @@
<?php
/**
* This controller handles all actions related to Components for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v3.0
*/
namespace App\Http\Controllers;
namespace App\Http\Controllers;
use App\Helpers\Helper;
use App\Models\Actionlog;
@ -28,6 +20,12 @@ use Slack;
use Str;
use View;
/**
* This class controls all actions related to Components for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class ComponentsController extends Controller
{
/**

View file

@ -1,13 +1,6 @@
<?php
/**
* This controller handles all actions related to Consumables for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.8
*/
namespace App\Http\Controllers;
namespace App\Http\Controllers;
use App\Helpers\Helper;
use App\Models\Actionlog;
@ -26,6 +19,12 @@ use Slack;
use Str;
use View;
/**
* This controller handles all actions related to Consumables for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class ConsumablesController extends Controller
{
/**

View file

@ -1,5 +1,24 @@
<?php
/*! \mainpage Snipe-IT Code Documentation
*
* \section intro_sec Introduction
*
* This documentation is designed to allow developers to easily understand
* the backend code of Snipe-IT. Familiarity with the PHP language is assumed,
* and experience with the Laravel framework (version 5.2) will be very helpful.
*
* **THIS DOCUMENTATION DOES NOT COVER INSTALLATION.** If you're here and you're not a
* developer, you're probably in the wrong place. Please see the
* [Installation documentation](http://docs.snipeitapp.com) for
* information on how to install Snipe-IT.
*
* To learn how to set up a development environment and get started developing for Snipe-IT,
* please see the [contributing documentation](http://docs.snipeitapp.com/contributing.html).
*
* Only the Snipe-IT specific controllers, models, helpers, service providers,
* etc have been included in this documentation (excluding vendors, Laravel core, etc)
* for simplicity.
*/
namespace App\Http\Controllers;
use Auth;

View file

@ -1,12 +1,4 @@
<?php
/**
* This controller handles all actions related to Custom Asset Fields for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v2.0
*/
namespace App\Http\Controllers;
use View;
@ -19,14 +11,26 @@ use App\Models\AssetModel;
use Lang;
use Auth;
/**
* This controller handles all actions related to Custom Asset Fields for
* the Snipe-IT Asset Management application.
*
* @todo Improve documentation here.
* @todo Check for raw DB queries and try to convert them to query builder statements
* @version v2.0
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
*/
class CustomFieldsController extends Controller
{
/**
* Display a listing of the resource.
*
* @return Response
*/
* Returns a view with a listing of custom fields.
*
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @since [v1.8]
* @return View
*/
public function index()
{
//
@ -39,10 +43,12 @@ class CustomFieldsController extends Controller
/**
* Show the form for creating a new resource.
*
* @return Response
*/
* Returns a view with a form for creating a new custom fieldset.
*
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @since [v1.8]
* @return View
*/
public function create()
{
//
@ -51,10 +57,12 @@ class CustomFieldsController extends Controller
/**
* Store a newly created resource in storage.
*
* @return Response
*/
* Validates and stores a new custom fieldset.
*
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @since [v1.8]
* @return Redirect
*/
public function store()
{
//
@ -68,6 +76,13 @@ class CustomFieldsController extends Controller
}
}
/**
* Associate the custom field with a custom fieldset.
*
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @since [v1.8]
* @return View
*/
public function associate($id)
{
@ -84,11 +99,29 @@ class CustomFieldsController extends Controller
return Redirect::route("admin.custom_fields.show", [$id])->with("success", Lang::get('admin/custom_fields/message.field.create.assoc_success'));
}
/**
* Returns a view with a form to create a new custom field.
*
* @see CustomFieldsController::storeField()
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @since [v1.8]
* @return View
*/
public function createField()
{
return View::make("custom_fields.create_field");
}
/**
* Validates and stores a new custom field.
*
* @see CustomFieldsController::createField()
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @since [v1.8]
* @return Redirect
*/
public function storeField()
{
$field=new CustomField(["name" => Input::get("name"),"element" => Input::get("element"),"user_id" => Auth::user()->id]);
@ -114,6 +147,13 @@ class CustomFieldsController extends Controller
}
}
/**
* Delete a custom field.
*
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @since [v1.8]
* @return Redirect
*/
public function deleteField($field_id)
{
$field=CustomField::find($field_id);
@ -127,11 +167,13 @@ class CustomFieldsController extends Controller
}
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
* Validates and stores a new custom field.
*
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @param int $id
* @since [v1.8]
* @return View
*/
public function show($id)
{
//$id=$parameters[0];
@ -158,11 +200,14 @@ class CustomFieldsController extends Controller
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
* What the actual fuck, Brady?
*
* @todo Uhh, build this?
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @param int $id
* @since [v1.8]
* @return Fuckall
*/
public function edit($id)
{
//
@ -170,11 +215,14 @@ class CustomFieldsController extends Controller
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
* GET IN THE SEA BRADY.
*
* @todo Uhh, build this too?
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @param int $id
* @since [v1.8]
* @return Fuckall
*/
public function update($id)
{
//
@ -182,11 +230,13 @@ class CustomFieldsController extends Controller
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
* Validates a custom fieldset and then deletes if it has no models associated.
*
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @param int $id
* @since [v1.8]
* @return View
*/
public function destroy($id)
{
//

View file

@ -1,12 +1,4 @@
<?php
/**
* This controller handles all actions related to the admin dashboard
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use App\Http\Controllers\AdminController;
@ -17,13 +9,22 @@ use Redirect;
use App\Models\Asset;
use App\Models\Company;
/**
* This controller handles all actions related to the Admin Dashboard
* for the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class DashboardController extends Controller
{
/**
* Show the administration dashboard page.
*
* @return View
*/
* Check authorization and display admin dashboard, otherwise display
* the user's checked-out assets.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @return View
*/
public function getIndex()
{
// Show the page

View file

@ -1,12 +1,4 @@
<?php
/**
* This controller handles all actions related to Asset Depreciation
* for the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use Input;
@ -19,14 +11,23 @@ use Str;
use View;
use Auth;
/**
* This controller handles all actions related to Depreciations for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class DepreciationsController extends Controller
{
/**
* Show a list of all the depreciations.
*
* @return View
*/
* Returns a view that invokes the ajax tables which actually contains
* the content for the depreciation listing, which is generated in getDatatable.
*
* @author [A. Gianotto] [<snipe@snipe.net]
* @see DepreciationsController::getDatatable() method that generates the JSON response
* @since [v1.0]
* @return View
*/
public function getIndex()
{
// Show the page
@ -35,10 +36,13 @@ class DepreciationsController extends Controller
/**
* Depreciation create.
*
* @return View
*/
* Returns a view that displays a form to create a new depreciation.
*
* @author [A. Gianotto] [<snipe@snipe.net]
* @see DepreciationsController::postCreate()
* @since [v1.0]
* @return View
*/
public function getCreate()
{
// Show the page
@ -48,10 +52,13 @@ class DepreciationsController extends Controller
/**
* Depreciation create form processing.
*
* @return Redirect
*/
* Validates and stores the new depreciation data.
*
* @author [A. Gianotto] [<snipe@snipe.net]
* @see DepreciationsController::postCreate()
* @since [v1.0]
* @return Redirect
*/
public function postCreate()
{
@ -77,11 +84,14 @@ class DepreciationsController extends Controller
}
/**
* Depreciation update.
*
* @param int $depreciationId
* @return View
*/
* Returns a view that displays a form to update a depreciation.
*
* @author [A. Gianotto] [<snipe@snipe.net]
* @see DepreciationsController::postEdit()
* @param int $depreciationId
* @since [v1.0]
* @return View
*/
public function getEdit($depreciationId = null)
{
// Check if the depreciation exists
@ -99,11 +109,14 @@ class DepreciationsController extends Controller
/**
* Depreciation update form processing page.
*
* @param int $depreciationId
* @return Redirect
*/
* Validates and stores the updated depreciation data.
*
* @author [A. Gianotto] [<snipe@snipe.net]
* @see DepreciationsController::getEdit()
* @param int $depreciationId
* @since [v1.0]
* @return Redirect
*/
public function postEdit($depreciationId = null)
{
// Check if the depreciation exists
@ -128,11 +141,14 @@ class DepreciationsController extends Controller
}
/**
* Delete the given depreciation.
*
* @param int $depreciationId
* @return Redirect
*/
* Validates and deletes a selected depreciation.
*
* This is a hard-delete. We do not currently soft-delete depreciations.
*
* @author [A. Gianotto] [<snipe@snipe.net]
* @since [v1.0]
* @return Redirect
*/
public function getDelete($depreciationId)
{
// Check if the depreciation exists
@ -156,6 +172,15 @@ class DepreciationsController extends Controller
}
/**
* Generates the JSON used to display the depreciation listing.
*
* @see DepreciationsController::getIndex()
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param string $status
* @since [v1.2]
* @return String JSON
*/
public function getDatatable()
{
$depreciations = Depreciation::select(array('id','name','months'));

View file

@ -1,12 +1,4 @@
<?php
/**
* This controller handles all actions related to User Groups for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use Config;
@ -18,13 +10,23 @@ use Validator;
use View;
use App\Models\Group;
/**
* This controller handles all actions related to User Groups for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class GroupsController extends Controller
{
/**
* Show a list of all the groups.
*
* @return View
*/
* Returns a view that invokes the ajax tables which actually contains
* the content for the user group listing, which is generated in getDatatable.
*
* @author [A. Gianotto] [<snipe@snipe.net]
* @see GroupsController::getDatatable() method that generates the JSON response
* @since [v1.0]
* @return View
*/
public function getIndex()
{
// Show the page
@ -32,10 +34,13 @@ class GroupsController extends Controller
}
/**
* Group create.
*
* @return View
*/
* Returns a view that displays a form to create a new User Group.
*
* @author [A. Gianotto] [<snipe@snipe.net]
* @see GroupsController::postCreate()
* @since [v1.0]
* @return View
*/
public function getCreate()
{
$group = new Group;
@ -50,10 +55,13 @@ class GroupsController extends Controller
}
/**
* Group create form processing.
*
* @return Redirect
*/
* Validates and stores the new User Group data.
*
* @author [A. Gianotto] [<snipe@snipe.net]
* @see GroupsController::getCreate()
* @since [v1.0]
* @return Redirect
*/
public function postCreate()
{
// create a new group instance
@ -73,11 +81,14 @@ class GroupsController extends Controller
}
/**
* Group update.
*
* @param int $id
* @return View
*/
* Returns a view that presents a form to edit a User Group.
*
* @author [A. Gianotto] [<snipe@snipe.net]
* @see GroupsController::postEdit()
* @param int $id
* @since [v1.0]
* @return View
*/
public function getEdit($id = null)
{
$group = Group::find($id);
@ -90,11 +101,14 @@ class GroupsController extends Controller
}
/**
* Group update form processing page.
*
* @param int $id
* @return Redirect
*/
* Validates and stores the updated User Group data.
*
* @author [A. Gianotto] [<snipe@snipe.net]
* @see GroupsController::getEdit()
* @param int $id
* @since [v1.0]
* @return Redirect
*/
public function postEdit($id = null)
{
@ -120,11 +134,14 @@ class GroupsController extends Controller
}
/**
* Delete the given group.
*
* @param int $id
* @return Redirect
*/
* Validates and deletes the User Group.
*
* @author [A. Gianotto] [<snipe@snipe.net]
* @see GroupsController::getEdit()
* @param int $id
* @since [v1.0]
* @return Redirect
*/
public function getDelete($id = null)
{
if (!config('app.lock_passwords')) {
@ -147,8 +164,14 @@ class GroupsController extends Controller
}
public function getDatatable($status = null)
/**
* Generates the JSON used to display the User Group listing.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v2.0]
* @return String JSON
*/
public function getDatatable()
{
if (Input::has('offset')) {

View file

@ -1,13 +1,4 @@
<?php
/**
* This controller handles all actions related to Licenses and
* License Seats for the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use Assets;
@ -33,6 +24,12 @@ use Session;
use App\Helpers\Helper;
use Auth;
/**
* This controller handles all actions related to Licenses for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class LicensesController extends Controller
{

View file

@ -1,13 +1,4 @@
<?php
/**
* This controller handles all actions related to Locations for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use Input;
@ -20,11 +11,14 @@ use Str;
use Validator;
use View;
use Auth;
use Symfony\Component\HttpFoundation\JsonResponse;
/**
* This controller handles all actions related to Locations for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class LocationsController extends Controller
{

View file

@ -1,12 +1,4 @@
<?php
/**
* This controller handles all actions related to Manufacturers for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use App\Models\Company;
@ -19,6 +11,12 @@ use Str;
use View;
use Auth;
/**
* This controller handles all actions related to Manufacturers for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class ManufacturersController extends Controller
{
/**

View file

@ -1,13 +1,4 @@
<?php
/**
* This controller handles user profile editing
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use Image;
@ -18,6 +9,12 @@ use View;
use Auth;
use App\Helpers\Helper;
/**
* This controller handles all actions related to User Profiles for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class ProfileController extends Controller
{
/**

View file

@ -1,13 +1,4 @@
<?php
/**
* This controller handles all reporting actions for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use App\Models\Accessory;
@ -30,6 +21,12 @@ use Redirect;
use App\Models\Setting;
use App\Models\User;
/**
* This controller handles all actions related to Reports for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class ReportsController extends Controller
{

View file

@ -1,13 +1,4 @@
<?php
/**
* This controller handles all actions related to Settings for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use Input;
@ -28,7 +19,10 @@ use App\Http\Requests\SetupUserRequest;
use App\Http\Requests\SettingRequest;
/**
* This class controls all actions related to settings
* This controller handles all actions related to Settings for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class SettingsController extends Controller
{

View file

@ -1,13 +1,4 @@
<?php
/**
* This controller handles all actions related to Status Labels for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use Input;
@ -23,6 +14,12 @@ use Auth;
use Symfony\Component\HttpFoundation\JsonResponse;
/**
* This controller handles all actions related to Status Labels for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class StatuslabelsController extends Controller
{
/**

View file

@ -1,13 +1,4 @@
<?php
/**
* This controller handles all actions related to Suppliers for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use Image;
@ -23,6 +14,12 @@ use Auth;
use Symfony\Component\HttpFoundation\JsonResponse;
/**
* This controller handles all actions related to Suppliers for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class SuppliersController extends Controller
{
/**

View file

@ -1,13 +1,4 @@
<?php
/**
* This controller handles all actions related to Users for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use App\Http\Requests\SetupUserRequest;
@ -39,7 +30,10 @@ use URL;
use View;
/**
* This class controls all actions related to users
* This controller handles all actions related to Users for
* the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class UsersController extends Controller
{

View file

@ -1,14 +1,4 @@
<?php
/**
* This controller handles all actions that allow a logged in user
* to view the assets assigned to them (and request an asset) for
* the Snipe-IT Asset Management application.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v1.0
*/
namespace App\Http\Controllers;
use App\Models\Accessory;
@ -30,6 +20,12 @@ use Slack;
use Validator;
use View;
/**
* This controller handles all actions related to the ability for users
* to view their own assets in the Snipe-IT Asset Management application.
*
* @version v1.0
*/
class ViewAssetsController extends Controller
{
/**

View file

@ -5,6 +5,11 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
/**
* Model for Accessories.
*
* @version v1.0
*/
class Accessory extends Model
{
use SoftDeletes;
@ -122,7 +127,7 @@ class Accessory extends Model
$search = explode('+', $search);
return $query->where(function ($query) use ($search) {
foreach ($search as $search) {
$query->whereHas('category', function ($query) use ($search) {
$query->where('categories.name', 'LIKE', '%'.$search.'%');

View file

@ -6,6 +6,12 @@ use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* Model for the Actionlog (the table that keeps a historical log of
* checkouts, checkins, and updates).
*
* @version v1.0
*/
class Actionlog extends Model implements ICompanyableChild
{
use SoftDeletes;

View file

@ -13,7 +13,11 @@ use Watson\Validating\ValidatingTrait;
use DateTime;
use App\Models\Setting;
/**
* Model for Assets.
*
* @version v1.0
*/
class Asset extends Depreciable
{
use SoftDeletes;

View file

@ -6,6 +6,11 @@ use Illuminate\Support\Facades\Lang;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
/**
* Model for Asset Maintenances.
*
* @version v1.0
*/
class AssetMaintenance extends Model implements ICompanyableChild
{
use SoftDeletes;
@ -104,7 +109,7 @@ class AssetMaintenance extends Model implements ICompanyableChild
{
return $query->where(function ($query) use ($search) {
$query->where('title', 'LIKE', '%'.$search.'%')
->orWhere('notes', 'LIKE', '%'.$search.'%')
->orWhere('asset_maintenance_type', 'LIKE', '%'.$search.'%')

View file

@ -5,6 +5,12 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
/**
* Model for Asset Models. Asset Models contain higher level
* attributes that are common among the same type of asset.
*
* @version v1.0
*/
class AssetModel extends Model
{
use SoftDeletes;

View file

@ -5,6 +5,14 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
/**
* Model for Categories. Categories are a higher-level group
* than Asset Models, and handle things like whether or not
* to require acceptance from the user, whether or not to
* send a EULA to the user, etc.
*
* @version v1.0
*/
class Category extends Model
{
@ -127,7 +135,7 @@ class Category extends Model
{
return $query->where(function ($query) use ($search) {
$query->where('name', 'LIKE', '%'.$search.'%')
->orWhere('category_type', 'LIKE', '%'.$search.'%');
});

View file

@ -4,6 +4,11 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Watson\Validating\ValidatingTrait;
/**
* Model for Companies.
*
* @version v1.8
*/
final class Company extends Model
{
protected $table = 'companies';
@ -139,7 +144,7 @@ final class Company extends Model
return $query;
} else {
$f = function ($q) {
static::scopeCompanyablesDirectly($q);
};

View file

@ -5,6 +5,12 @@ use Illuminate\Database\Eloquent\Model;
use \Illuminate\Database\Eloquent\Builder;
use \Illuminate\Database\Eloquent\Scope;
/**
* Handle query scoping for full company support.
*
* @todo Move this to a more Laravel 5.2 esque way
* @version v1.0
*/
final class CompanyableChildScope implements Scope
{
/**

View file

@ -5,6 +5,12 @@ use Illuminate\Database\Eloquent\Model;
use \Illuminate\Database\Eloquent\Builder;
use \Illuminate\Database\Eloquent\Scope;
/**
* Handle query scoping for full company support.
*
* @todo Move this to a more Laravel 5.2 esque way
* @version v1.0
*/
final class CompanyableScope implements Scope
{
/**

View file

@ -11,6 +11,11 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;
/**
* Model for Components.
*
* @version v1.0
*/
class Component extends Model
{
use SoftDeletes;
@ -116,7 +121,7 @@ class Component extends Model
$search = explode(' ', $search);
return $query->where(function ($query) use ($search) {
foreach ($search as $search) {
$query->whereHas('category', function ($query) use ($search) {
$query->where('categories.name', 'LIKE', '%'.$search.'%');

View file

@ -1,17 +1,16 @@
<?php
/**
* This service provider handles a few custom validation rules.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v3.0
*/
namespace App\Providers;
use Validator;
use Illuminate\Support\ServiceProvider;
/**
* This service provider handles a few custom validation rules.
*
* PHP version 5.5.9
* @version v3.0
*/
class AppServiceProvider extends ServiceProvider
{
/**