This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adding Product in Admin | |
================================== | |
SELECT | |
product.*, product_variation.*, product_option.* | |
FROM product | |
LEFT JOIN product_variation ON product_variation.product_id = product.product_id | |
LEFT JOIN product_option ON product_option.product_id = product.product_id | |
LEFT JOIN order_product ON order_product.product_id = product.product_id | |
LEFT JOIN customer_order ON customer_order.order_id = order_product.order_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
User::where('user_id','=', $this->id) | |
->where('some condition here') | |
->join('items', 'items.user_id', '=', 'users.id') | |
->with('items') | |
->orderBy('items.type') | |
->get(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
User::where('user_id','=', $this->id) | |
->where('some condition here') | |
->join('items', 'items.user_id', '=', 'users.id') | |
->orderBy('items.type') | |
->get(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iVBORw0KGgoAAAANSUhEUgAAAyAAAAQrCAIAAAD7cl9yAAAAA3NCSVQICAjb4U/gAAAgAElEQVR4nEy927Ik2Y4c5g5gRe7qPkPTg75GeiBFUuKMSJmkMf2N3vUV+srROd2VGQtwPfiKXV1zbKytu3buyHUBHO4OBP/f/+f/FuKeyevqGa6KIGZLw0pJK3Jl/ew/otCq4CIxo4iiOL27myAYM8qIiOC0MBXZMyCi6jO7NRUZo4zs6elN6L4/mRkRvTcAkEH23mt9kTOTZAIz00FAUs/7/lzX1fddtUjt0Xu/16qkgM7AdDOSTKmnd5AAgGBkt8gAZiau15fE7p65I5TJmZ7ZAHsPlcnCSOTWMAPsuxugNBK6JyIkAcgsACGqOzPvbmbuzzurBoyMVSUNiQjOtB9pd0dGZO69qwqIyjUjKfbeERxqGmutPGsRkqQB6M9BoHt/vV4kP/c9M0BU1RB7Wj0kiZC0tatC3RxBM7uDASa5MDMzQ0SFWjM7EoDe9+fH10v+jwESCZJJpKSq6r1HE4zMnJmmmAlgT5MgICIUAZIhDSkyiZJEJklR3bt7Sz0anwSIQEgMFoDRHiI0QACYBggFJRGYmStXT5MDiCFAM0NSsyESnBkAyQBH0iBGCCIz1HuCFPyHTFJkCBRERGZK8ieQjAgSErolEREAGIxMAWAAkkZBIrqngjNdFVAzQxr1MGJ6CPUenR0lEaOOCLVIzGwf4IgAyBEJkhgyY2ZWFsl7bxDPIcyGMMKoIiQJoARAJMmRWoPgdFdwIAQkEPR3ZLCyJO09UIAbAAfJYmb3HaAkCREx2uLklaEAxp8wHABUQKyoaZAx0wIERJAUMl716m4ArCQZipYGguMICQGkIEnhRU7MDMXMmhkMQyDP5gLo2RHsPQCzuPdeK7vb//25qjrXENHdRUrKKk1rZjBDhOBfSpJkS6Mh6Yfb6sjEAD1NNnh/bkV87k3yj7//g8J+f+6fP3vvCN393vcGYvoeTGbuu33drtdSD0YkpkUA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// refining the query | |
User::search('tisuchi')->where('is_active', '=', 1)->get(); | |
User::search('tisuchi')->latest()->get(); | |
User::search('tisuchi')->paginate(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class User extends Authenticatable | |
{ | |
use FullTextSearch; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
trait FullTextSearch | |
{ | |
/** | |
* Replaces spaces with full text search wildcards | |
* | |
* @param string $term |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The columns of the full text index | |
*/ | |
protected $searchable = [ | |
'first_name', | |
'last_name', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function store(Request $request) | |
{ | |
$valueYouWantToAdd = "Your some data"; | |
$request->request->add(['arrayKeyName' => $valueYouWantToAdd]); | |
//now return to check whether working or not | |
return $request->all(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
this.$http.get('api/products', {params: {page: page}} ).then( | |
function (response) { | |
//look into the routes file and format your response | |
this.$set('items', response.data.data.data); | |
this.$set('pagination', response.data.pagination); | |
}, function (error) { | |
// handle error |