public function connections()
{
$relation = $this
->belongsToMany(static::class, 'connections', 'requestor_id', 'requested_id')
->withTimestamps();
/// delete the already built inner join
$relation
->getQuery() // Eloquent\Builder
This file contains 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
Allow display images and youtube video: | |
CSS class for links .htmllink and images .htmlimg | |
public function linkify($showimg = 1, $value, $protocols = array('http', 'mail', 'https'), array $attributes = array('target' => '_blank')) | |
{ | |
// Link attributes | |
$attr = ''; | |
foreach ($attributes as $key => $val) { | |
$attr = ' ' . $key . '="' . htmlentities($val) . '"'; | |
} |
This file contains 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
/* ******************************************************************************************* | |
* GLOBAL CONFIG | |
* Vue.config is an object containing Vue’s global configurations. | |
* You can modify its properties listed below before bootstrapping your application. | |
* https://vuejs.org/v2/api/#Global-Config | |
* ******************************************************************************************* */ | |
// Configure whether to allow vue-devtools inspection | |
Vue.config.devtools = true |
This file contains 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
Route Controller: | |
//List Products | |
Route::get('products','ProductController@index'); | |
//List single Product | |
Route::get('product/{id}','ProductController@show'); | |
//Create new Product | |
Route::post('product','ProductController@store'); | |
//Update Product | |
Route::put('product','ProductController@store'); | |
//Delete Product |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder