Skip to content

Commit 0db6ab2

Browse files
nshirotaylorotwell
andauthored
Update contextual attributes example (#10037)
* Update contextual attributes example * Update container.md --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
1 parent c4151f0 commit 0db6ab2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

container.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,15 +266,17 @@ In addition to the `Storage` attribute, Laravel offers `Auth`, `Cache`, `Config`
266266

267267
namespace App\Http\Controllers;
268268

269+
use App\Models\Photo;
269270
use Illuminate\Container\Attributes\Auth;
270271
use Illuminate\Container\Attributes\Cache;
271272
use Illuminate\Container\Attributes\Config;
272273
use Illuminate\Container\Attributes\DB;
273274
use Illuminate\Container\Attributes\Log;
275+
use Illuminate\Container\Attributes\RouteParameter;
274276
use Illuminate\Container\Attributes\Tag;
275277
use Illuminate\Contracts\Auth\Guard;
276278
use Illuminate\Contracts\Cache\Repository;
277-
use Illuminate\Contracts\Database\Connection;
279+
use Illuminate\Database\Connection;
278280
use Psr\Log\LoggerInterface;
279281

280282
class PhotoController extends Controller
@@ -285,6 +287,7 @@ class PhotoController extends Controller
285287
#[Config('app.timezone')] protected string $timezone,
286288
#[DB('mysql')] protected Connection $connection,
287289
#[Log('daily')] protected LoggerInterface $log,
290+
#[RouteParameter('photo')] protected Photo $photo,
288291
#[Tag('reports')] protected iterable $reports,
289292
)
290293
{

0 commit comments

Comments
 (0)