Giter VIP home page Giter VIP logo

Some libary for dev in laravel 5.*

Installation

composer require sawyes/sawyes

Basic Usage

1.LoggerHelper

  • import namespace in your program
use Sawyes\Log\LoggerHelper;
  • usage
// write('message', array(), 'log-file-name');
LoggerHelper::write('Login info:', ['username'=>'Admin', 'password'], 'logger');

then you can find log file

path/to/project/storage/log/logger-2017-10-12.log

[2017-10-12 14:22:54] local.DEBUG: file: web.php line: 16 message: Login info: {"username":"Admin","0":"password"}  

2.Log SQL Service Provider

  • add provider services in config/app.php

laravel >=5.5 skip this step .

'providers' => [
    ...
    Sawyes\LogSqlServiceProvider::class,
    ...
    ]
  • publishes config to enable log

<= 5.4

php artisan vendor:publish --tag='Sawyes\LogSqlServiceProvider'

5.4 check package php artisan package:discover , then run below command choice Sawyes\LogSqlServiceProvider

php artisan vendor:publish
  • configure env file write APP_DEBUG_LOG=true in your .env file

now your can find log file in your storage path!

3. schedule run lists

  • add provider services in config/app.php

laravel >=5.5 skip this step .

'providers' => [
    ...
    Sawyes\SchedulelistServiceProvider::class,
    ...
    ]
  • show schedule list
php artisan schedule:detail
  • publishes config to enable log

you can skip thie step, it's save schedule:detail in database using config file

<= 5.4

php artisan vendor:publish --tag='Sawyes\SchedulelistServiceProvider'

5.4 check package php artisan package:discover , then run below command choice Sawyes\LogSqlServiceProvider

php artisan vendor:publish

you need to determine connection name, schedule list table, schedule detail list table

run below command save schedule list when end of day.

schedule:detail --database=true --start=tomorrow

happy hacking!

sawyes's Projects

sawyes doesnโ€™t have any public repositories yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.