Example #1
0
 /**
  * Get a storage model.
  *
  * @param  string $key
  * @return Anbu\Models\Storage
  */
 public function get($key = null)
 {
     // If no key has been provided.
     if (is_null($key)) {
         // Return the latest storage record.
         return Storage::orderBy('id', 'desc')->firstOrFail();
     }
     // Return a storage record by key.
     return Storage::findOrFail($key);
 }