發表文章

目前顯示的是 3月 24, 2019的文章

Juan Álvarez Mendizábal

圖片
This article may be expanded with text translated from the corresponding article in Spanish . (March 2016) Click [show] for important translation instructions. Machine translation like Deepl or Google Translate is a useful starting point for translations, but translators must revise errors as necessary and confirm that the translation is accurate, rather than simply copy-pasting machine-translated text into the English Wikipedia. Do not translate text that appears unreliable or low-quality. If possible, verify the text with references provided in the foreign-language article. You must provide copyright attribution in the edit summary accompanying your translation by providing an interlanguage link to the source of your translation. A model attribution edit summary (using German): Content in this edit is translated from the existing German Wikipedia article at [[:de:Exact name of German article]]; see its history for attribution. You should also add the template {{Tr

How to use orderBy() with model's method in Laravel

圖片
-2 How can I use orderBy to order by a model's method? Consider the model User and the method public function fullName() { return $this->firstName . $this->lastName; } I want to do something like orderBy('fullName'). Is this possible? I know I can make equivalent code using Query Builder, but I want to keep my Model methods as they are. laravel laravel-5 eloquent laravel-query-builder share | improve this question edited Nov 24 '18 at 19:05 Josh asked Nov 23 '18 at 0:48