Created
March 15, 2015 01:40
-
-
Save snown/f1b976946fc9845eb196 to your computer and use it in GitHub Desktop.
FatalErrorException in AccountController.php: Class 'App\Facades\QueryCache' not found
This file contains 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\Http\Controllers; | |
use App\Facades\QueryCache; | |
use App\Http\Requests; | |
use App\Http\Controllers\Controller; | |
use App\Models\Account; | |
use DebugBar\DebugBar; | |
use Illuminate\Database\Eloquent\Builder as EloquentQuery; | |
use Illuminate\Database\Eloquent\Collection; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Session; | |
use Illuminate\Support\Facades\Cache; | |
class AccountController extends Controller { | |
/** | |
* Display the specified resource. | |
* | |
* @param int $id | |
* @return Response | |
*/ | |
public function show($id) | |
{ | |
$test = QueryCache::cacheKeyFromQuery(Account::where('AccountNumber', '=', $id)); | |
dd($test); | |
} | |
} |
This file contains 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 | |
return [ | |
'providers' => [ | |
// Stuff... | |
'App\Providers\HelpersServiceProvider', | |
], | |
'aliases' => [ | |
// Stuff... | |
'QueryCache' => 'App\Facades\QueryCache', | |
], | |
]; |
This file contains 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\Providers; | |
use App\Helpers\QueryCacheHelper; | |
use Illuminate\Support\ServiceProvider; | |
class HelpersServiceProvider extends ServiceProvider { | |
/** | |
* Bootstrap the application services. | |
* | |
* @return void | |
*/ | |
public function boot() | |
{ | |
// | |
} | |
/** | |
* Register the application services. | |
* | |
* @return void | |
*/ | |
public function register() | |
{ | |
$this->app->bind('queryCache', function () { | |
return new QueryCacheHelper; | |
}); | |
} | |
} |
This file contains 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\Facades; | |
use Illuminate\Support\Facades\Facade; | |
class QueryCache extends Facade { | |
protected static function getFacadeAccessor() { return 'queryCache'; } | |
} |
This file contains 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\Helpers; | |
use Closure; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Support\Facades\Cache; | |
use Illuminate\Database\Eloquent\Builder as EloquentQuery; | |
class QueryCacheHelper { | |
// Implementation | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment