| 1 | <?php |
||
| 8 | class SystemController extends Controller |
||
| 9 | { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Log the hit and redirect to the url. |
||
| 13 | * |
||
| 14 | * @param Link $link |
||
| 15 | * |
||
| 16 | * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector |
||
| 17 | */ |
||
| 18 | public function show(Link $link) |
||
| 19 | { |
||
| 20 | $link->hits()->create([ |
||
| 21 | 'ip' => request()->ip(), |
||
| 22 | 'user_agent' => request()->server('HTTP_USER_AGENT'), |
||
| 23 | ]); |
||
| 24 | |||
| 25 | return redirect($link->url); |
||
|
|
|||
| 26 | } |
||
| 27 | |||
| 28 | |||
| 29 | /** |
||
| 30 | * Show the form for creating a new resource. |
||
| 31 | * @return \Illuminate\Http\Response |
||
| 32 | */ |
||
| 33 | public function create() |
||
| 37 | |||
| 38 | |||
| 39 | /** |
||
| 40 | * Store a newly created resource in storage. |
||
| 41 | * |
||
| 42 | * @param \App\Http\Requests\Frontend\SubmitUrlRequest $request |
||
| 43 | * |
||
| 44 | * @return \Illuminate\Http\RedirectResponse |
||
| 45 | */ |
||
| 46 | public function store(SubmitUrlRequest $request, Link $link) |
||
| 56 | } |
||
| 57 |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.