Skip to content

Commit

Permalink
Added comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
furic committed Dec 1, 2020
1 parent 4fc80f1 commit 4be7ac5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"authors": [
{
"name": "Richard Fu",
"email": "[email protected]"
"email": "[email protected]",
"homepage": "https://www.richardfu.net",
"role": "Developer"
}
],
"require": {
Expand Down
20 changes: 13 additions & 7 deletions src/Http/Controllers/RedeemCodeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class RedeemCodeController extends Controller
{

/**
* Display a listing of the resource.
* Display a listing of the redeem code resource.
*
* @return \Illuminate\View\View
*/
Expand All @@ -31,7 +31,7 @@ public function index()
}

/**
* Show the form for creating a new resource.
* Show the form for creating a new redeem code resource.
*
* @return \Illuminate\View\View
*/
Expand Down Expand Up @@ -81,6 +81,12 @@ public function create(Request $request)
return view('redeem-codes::added', compact('codes'));
}

/**
* Generate a random string with given length.
*
* @param int $length
* @return string
*/
private function generateRandomString($length = 10)
{
$characters = '23456789ABCDEFGHJKLMNPQRSTUVWXYZ';
Expand All @@ -93,7 +99,7 @@ private function generateRandomString($length = 10)
}

/**
* Store a newly created resource in storage.
* Store a newly created redeem code resource in storage.
*
* @param Request $request
* @return \Illuminate\View\View
Expand All @@ -104,7 +110,7 @@ public function store(Request $request)
}

/**
* Display the specified resource.
* Display the specified redeem code resource.
*
* @param int $id
* @return \Illuminate\View\View
Expand All @@ -115,7 +121,7 @@ public function show($id)
}

/**
* Show the form for editing the specified resource.
* Show the form for editing the specified redeem code resource.
*
* @param int $id
* @return \Illuminate\View\View
Expand All @@ -126,7 +132,7 @@ public function edit($id)
}

/**
* Update the specified resource in storage.
* Update the specified redeem code resource in storage.
*
* @param Request $request
* @param int $id
Expand All @@ -138,7 +144,7 @@ public function update(Request $request, $id)
}

/**
* Remove the specified resource from storage.
* Remove the specified redeem code resource from storage.
*
* @param int $id
* @return \Illuminate\View\View
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/RedeemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class RedeemController extends Controller
{

/**
* Update the specified resource in storage.
* Check validation and redeem a given redeem code.
*
* @param string $code
* @return \Illuminate\Http\Response
Expand Down
4 changes: 2 additions & 2 deletions src/RedeemCodesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public function boot()
*/
public function register()
{
$this->app->make('Furic\RedeemCodes\RedeemCodeController');
$this->app->make('Furic\RedeemCodes\RedeemController');
$this->app->make('Furic\RedeemCodes\Http\Controllers\RedeemCodeController');
$this->app->make('Furic\RedeemCodes\Http\Controllers\RedeemController');
// $this->mergeConfigFrom(
// __DIR__ . '/../config/redeem-codes.php', 'redeem-codes'
// );
Expand Down

0 comments on commit 4be7ac5

Please sign in to comment.