Skip to content

Instantly share code, notes, and snippets.

@luiscelismx
Created February 28, 2014 22:31
Show Gist options
  • Select an option

  • Save luiscelismx/9281379 to your computer and use it in GitHub Desktop.

Select an option

Save luiscelismx/9281379 to your computer and use it in GitHub Desktop.
Command Laravel 4 para reiniciar puntos por logeo
<?php
/*
-- =============================================
-- Author: Luis Antonio Celis Molina
-- Create date: 04/01/2014
-- Description: Clase para reiniciar la bandera que indica el otorgar los respectivos puntos por iniciar sesion
-- La ejecución es administrada mediante un cron
-- =============================================
*/
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class ReiniciarPuntosLogeoDiarioCommand extends Command {
/**
* The console command name.
*
* @var string
*/
protected $name = 'command:name';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
//
$date = new ExpressiveDate;
DB::table('miTabla')->where('miCampo', 1)->update(array('miCampo'=> 0));
}
/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return array(
array('example', InputArgument::REQUIRED, 'An example argument.'),
);
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return array(
array('example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment