TODO:
Hay funciones genericas. Deberia meterlo en HomeController mas bien. O en un Controller parent de todo, no se si hay.
note that main branch is main
, not master
, so git pull/push origin main
[...]
resources/app.js
(npm watch will convert it into/public/app.js
)*.vue
The main component to show the buy orders. -- It communicates with Laravel through axios in order to execute the actions.
-- Laravel communicates with the vue component through app.js, using window.* variables and methods, and using$emit
, in order to execute a fn inside vue to update the state of current symbol.
--localStorage
, to save the status of current symbol and load it in case we reload page.
web.php
: for routing and endpoint of ajax calls.MyBinanceController
: all important generic functions related to communic with binance- home.blade.php : Main view containing all of the rest. Only allowed if logged in.
-- top row with balance and coins:BinanceBalance.php
+binance-balance.blade.php
-- left column with trades:BinanceTrades.php
+binance-trades.blade.php
--- single trade component:SingleTrade.php
npm install && npm run dev
- edit .env
source .env
npm run watch
cd public
php -S localhost:9001 - open
localhost:9001
in browser.
Valid for all Laravel 7 apps.
composer global require "laravel/installer=~1.1"
composer create-project laravel/laravel lar-binance --prefer-dist
- Create DB with mysql command
- Edit .env with DB connection
source .env
php artisan config:cache && php artisan config:clear
php artisan storage:link
composer require laravel/ui
chmod -R o+w storage
php artisan migrate
php artisan db:seed
npm install && npm run dev
- HOW I USE TWITTER BOOSTRAP:
Edit app.scss
@import 'variables';
@import '~bootstrap/scss/bootstrap';
- The partial Laravel component accepts params,
- This is complex, I couldnt find a better way to do it.
- js call:
window.UIMethods.reloadTemplate('binance-trades', { symbol:symbol } )
app.js
: calls with axios ajax the the endpoint called '/load-partial-ajax?template=binance-trades&symbol=TFUELUSDT'web.php
: routing of endpoint '/load-partial-ajax' to the generic viewpartial-load-template-ajax.blade
, pasing the $_GET as params to be used in the view.partial-load-template-ajax.blade
calls the right component depending on the template. In this case:BinanceTrades.php::__construct()
grabs the params from REQUEST, returns the viewviews/components/binance-trades.blade.php
, shows all the info.