Output checkboxes with appropriate 'checked' attributes in Laravel
1 Response
On line 6, you create a variable $cats and assign it the return value of the static 'all' function located within the Cat class. Your comments say that it's to fetch all the categories, but then you never use the variable $cats again. If you're not going to do anything with the returned value, you should just call the method from the class statically while not assigning a value to a new, unused variable. The line can just simply state:
Cat::all();
... unless you planned to do some error checking and/or use $cats, then the variable is entirely superfluous and a waste of CPU cycles and memory both.
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.
1 Response
Cat::all();
... unless you planned to do some error checking and/or use $cats, then the variable is entirely superfluous and a waste of CPU cycles and memory both.
Write a comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.