This is my upload-file
type for what I use at work. We use angular-upload for the upload
service to do the actual file uploading. We also have several abstractions and use ES6 that may confuse you a little bit (sorry about that). Hopefully this gets you started though.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App::before(function($request) | |
{ | |
header('Access-Control-Allow-Origin: *'); | |
header('Access-Control-Allow-Methods: GET, POST, OPTIONS'); | |
header('Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization, X-Request-With'); | |
header('Access-Control-Allow-Credentials: true'); | |
}); |
This setup involves creating a Laravel API and an Angular client-app with Gulp covering the asset pipeline.
Our Laravel API server will serve one view only and that is to simply load the Angular app.
First, create a new directory for your project. We're going to place the server
and client
directories in here. You'll need to install Laravel, Yeoman, generator-gulp-angular and any other dependencies.