I already tried following this tutorial but I keep getting an error that's why I was looking for a step-by-step thinking that since the video is based on Laravel 4 I needed to do something different.
This is the code I have from following the tutorial you suggested.
File Structure
app/
+---Acme/
+-------Facades/
|------------Search.php
+-------Search/
|------------Search.php
|------------SearchServiceProvider.php
CODE:
Routes.php
Route::get('foo', function()
{
return Acme\Facades\Search::acme();
});
File: app/Facades/Search.php
<?php namespace Acme\Facades;
use Illuminate\Support\Facades\Facade;
class Search extends Facade{
protected static function getFacadeAccessor()
{
return 'search';
}
}
File: app/Search/Search.php
<?php namespace Acme\Search;
use Illuminate\Support\Collection;
class Search{
public function acme()
{
echo 'Message from Acme';
}
}
File: app/Search/SearchServiceProvider.php
<?php namespace Acme\Search;
use Illuminate\Support\ServiceProvider;
class SearchServiceProvider extends ServiceProvider{
public function register()
{
$this->app->bind('search', 'Acme\Search\Search' );
}
}
File: config/app.php
...
'Illuminate\View\ViewServiceProvider',
'Acme\Search\SearchServiceProvider',
ERROR:
Class 'Acme\Search\SearchServiceProvider' not found
Any Suggestion? What am I doing wrong?