/**
  * Create a new migration at the given path.
  *
  * @param  string  $name
  * @param  string  $path
  * @param  string  $table
  * @param  bool    $create
  * @return void
  */
 public function create($name, $path, $table = null, $create = false)
 {
     $path = $this->getPath($name, $path);
     // First we will get the stub file for the migration, which serves as a type
     // of template for the migration. Once we have those we will populate the
     // various place-holders, save the file, and run the post create event.
     $stub = $this->getStub($table, $create);
     $this->files->put($path, $this->populateStub($name, $stub, $table));
     $this->firePostCreateHooks();
 }
 /**
  * Write the stub ServiceProvider for the package.
  *
  * @param  Illuminate\Workbench\Package  $package
  * @param  string  $directory
  * @return void
  */
 public function writeServiceProvider(Package $package, $directory, $plain)
 {
     // Once we have the service provider stub, we will need to format it and make
     // the necessary replacements to the class, namespaces, etc. Then we'll be
     // able to write it out into the package's workbench directory for them.
     $stub = $this->getProviderStub($plain);
     $stub = $this->formatPackageStub($stub, $package);
     $path = $this->createClassDirectory($package, $directory);
     // The primary source directory where the package's classes will live may not
     // exist yet, so we will need to create it before we write these providers
     // out to that location. We'll go ahead and create now here before then.
     $file = $path . '/' . $package->name . 'ServiceProvider.php';
     $this->files->put($file, $stub);
 }
 /**
  * Write the service manifest file to disk.
  *
  * @param  array  $manifest
  * @return array
  */
 public function writeManifest($manifest)
 {
     $path = $this->manifestPath . '/services.json';
     $this->files->put($path, json_encode($manifest));
     return $manifest;
 }
 /**
  * Store an item in the cache for a given number of minutes.
  *
  * @param  string  $key
  * @param  mixed   $value
  * @param  int     $minutes
  * @return void
  */
 protected function storeItem($key, $value, $minutes)
 {
     $value = $this->expiration($minutes) . serialize($value);
     $this->files->put($this->path($key), $value);
 }
 /**
  * Write the service manifest file to disk.
  *
  * @param  Illuminate\Foundation\Application  $app
  * @param  array  $manifest
  * @return array
  */
 public function writeManifest(Application $app, $manifest)
 {
     $this->files->put($this->manifestPath($app), json_encode($manifest));
     return $manifest;
 }
 /**
  * Create a new resourceful controller file.
  *
  * @param  string  $controller
  * @param  string  $path
  * @param  array   $options
  * @return void
  */
 public function make($controller, $path, array $options = array())
 {
     $stub = $this->addMethods($this->getController($controller), $options);
     $this->files->put($path . "/{$controller}.php", $stub);
 }
 /**
  * Create a new session in storage.
  *
  * @param  string  $id
  * @param  array   $session
  * @param  Symfony\Component\HttpFoundation\Response  $response
  * @return void
  */
 public function createSession($id, array $session, Response $response)
 {
     $this->files->put($this->getFilePath($id), serialize($session));
 }