Skip to content

Instantly share code, notes, and snippets.

View alixcan's full-sized avatar
💭
I may be slow to respond.

Alican alixcan

💭
I may be slow to respond.
View GitHub Profile
@alixcan
alixcan / laravel.js
Created March 29, 2018 23:48 — forked from JeffreyWay/laravel.js
Want to send a DELETE request when outside of a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. (Requires jQuery, but doesn't have to.) To use, import script, and create a link with the `data-method="DELETE"` attribute.
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
*/
(function() {
@alixcan
alixcan / laravel.js
Created March 30, 2018 00:11 — forked from roNn23/laravel.js
Updated delete-script of Jeffrey Way to work with Laravel 5. And optimized the implementation for the CSRF token.
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
Add this to your view:
<script>
window.csrfToken = '<?php echo csrf_token(); ?>';
@alixcan
alixcan / directives.php
Created April 6, 2018 14:21 — forked from kelixlabs/directives.php
Laravel Blade Directive To Set Active Menu Class
<?php
Blade::directive('active', function ($expression) {
return "<?php echo active_url($expression); ?>";
});
@alixcan
alixcan / EloquentCheatSheet.md
Created April 27, 2018 15:02 — forked from avataru/EloquentCheatSheet.md
Eloquent relationships cheat sheet
@alixcan
alixcan / LogAfterRequest.php
Created September 6, 2018 10:50 — forked from Shelob9/LogAfterRequest.php
Log all request to Laravel app. Based on http://blog.phakeapps.com/2015/06/23/log-every-request-and-response-in-laravel-5/ updated for Laravel 5.3
namespace App\Http\Middleware;
use Illuminate\Support\Facades\Log;
class LogAfterRequest {
public function handle($request, \Closure $next)
{
return $next($request);
}
@alixcan
alixcan / index.php
Created September 6, 2018 11:00 — forked from xDimGG/index.php
Populated Discord WebHook
<?php
$url = 'https://discordapp.com/api/webhooks/402545221445091348/Cu8aLPPtgGMTyINj-DOjy91NCdnDMKczdFmsJmO2u4I6l7fzyNV_YYtezwwU7QF4CkrD';
$image = 'https://via.placeholder.com/400x400';
$data = json_encode([
// These 2 should usually be left out
// as it will overwrite whatever your
// users have set
// 'username' => 'Test WebHook',
// 'avatar_url' => $image,
@alixcan
alixcan / git-aliases
Created November 12, 2018 12:24 — forked from lukalopusina/git-aliases
GIT Aliases
# GIT
# --------------------------------------------
alias ga="git add"
alias gaa="git add ."
alias gc="git commit -m "
alias gp="git push github"
alias gs="git status"
alias nah="git reset --hard; git clean -df;"
# --------------------------------------------
@alixcan
alixcan / gist:24dbf99c3d8d6e0d1f9c4011f920be7b
Created February 24, 2019 14:32 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1

Laravel-websockets, SSL Certificate, Let's Encrypt, Certbot, Supervisor, Digitalocean Ubuntu

I did two days work to run laravel-websockets on my server. It will be nice to share with you.

Steps

Step1 - Laravel Websockets Installation with composer

Laravel WebSockets can be installed via composer: