- Prefer types over interfaces for simple data structures
- Use interfaces and class OOP for more complex components
- Comments should be used to explain "why" decisions were made with possible source references
- Avoid magic numbers or strings - use constants instead, and if they feel like configuration values, move them to a configuration file
- Avoid default parameter values especially in method signatures since this can lead to unexpected behavior. For example if a method signature has three arguments, then a caller is required to pass in exactly three arguments.
- Avoid null coalescing (??) or fallbacks. All values should always be explicitly set.
- Avoid default parameters / default fallbacks / etc. since this silently obfuscates errors. Errors should always propagate so we can discover potential issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"lastUpload":"2021-09-12T12:37:55.342Z","extensionVersion":"v3.4.3"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // This can be found in the Symfony\Component\HttpFoundation\Response class | |
| const HTTP_CONTINUE = 100; | |
| const HTTP_SWITCHING_PROTOCOLS = 101; | |
| const HTTP_PROCESSING = 102; // RFC2518 | |
| const HTTP_OK = 200; | |
| const HTTP_CREATED = 201; | |
| const HTTP_ACCEPTED = 202; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Convert a comma separated file into an associated array. | |
| * The first row should contain the array keys. | |
| * | |
| * Example: | |
| * | |
| * @param string $filename Path to the CSV file | |
| * @param string $delimiter The separator used in the file | |
| * @return array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Redirect the User to Paystack / Paypal Payment Page | |
| * @param Request $request | |
| * @return URL | |
| */ | |
| public function redirectToGateway(Request $request) | |
| { | |
| //Check if user is logged in | |
| if(Auth::check()){ | |
| //Check if the subscription for Professional Plan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Console\Commands; | |
| use Illuminate\Console\Command; | |
| class EnsureQueueListenerIsRunning extends Command | |
| { | |
| /** | |
| * The name and signature of the console command. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static function upload(UploadedFile $file) | |
| { | |
| $fileMedia = new static; | |
| $file->name = time().'_'. strtolower( $file->getClientOriginalName() ); | |
| Image::make($file)->resize(1360, 760)->save(config('admin.fileUploadDirectory') . $file->name); | |
| // $file->move(config('admin.fileUploadDirectory'), $file->name); | |
| return $file; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @extends('layouts.app') | |
| @section('content') | |
| <div class="container auth"> | |
| <div class="row"> | |
| <div class="col-md-12"> | |
| <div class="auth-heading"> | |
| <h4 class="text-center" style="color:rgba(0, 0, 0, 1)"><strong>ALL CASES</strong></h4> | |
| <h5 class="text-center" style="color:rgba(0, 0, 0, 1)">List of all cases and Timeline for each</h5> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "result": 200, | |
| "message": "Messages were sent successfully", | |
| "transaction_code":"892893892893" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $api = "http://push.cellcore.com.ng/api/v1/push"; | |
| $header = array( | |
| 'Authorization' => "API_KEY" | |
| ); | |
| $params = array( | |
| 'type' => "txt", | |
| 'payload' => "Thanks for choosing Push It....", | |
| 'group_msg'=>"1", |
NewerOlder