How would you write self-participation in eloquence? Do I need to define relationships on a model?
Here is my statement:
SELECT t2.title FROM products t1, products t2 WHERE t1.id = $id AND t2.color_id = t1.color_id AND t2.id != $id
You can simply determine your attitude to yourself.
public function parent() { return $this->belongsTo(self::class, 'color_id'); } public function children() { return $this->hasMany(self::class, 'color_id'); }
Source: https://habr.com/ru/post/988379/More articles:https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/988374/my-ftp-batch-script-is-stuck-on-200-port-command-successful-and-doesnt-upload-the-files-to-server&usg=ALkJrhiEGLMh3p6TdKc_VVCa-NgjnVwIbgUsing ajax polymer reaction - javascriptAn executable file containing data - haskellRemoving the first line when rendering data in symfony2 - phpwhy smooth carousel doesnβt work with browser? - jqueryhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/988380/libgdx-on-desktop-determine-if-mouse-outside-window&usg=ALkJrhglhzHT30s3ZdrTg2x4-laAEoCnBwIncrease button click area - androidAlgorithmic Thinking Guide (Four-Quarter Equation) - algorithmHow to change the default search in Visual Studio 2015 - c #How can URL encode $ template interpolation expressions? - javascriptAll Articles