Laravel and AngularJS Starter Application Boilerplate featuring Laravel 5.3 and AngularJS 1.5.8

Overview

๐Ÿ’ Zemke/starter-laravel-angular has been upgraded to AngularJS 1.5.8.

๐Ÿ’ Zemke/starter-laravel-angular has been upgraded to Laravel 5.3. You can pull the changes and run rm composer.lock && composer install --prefer-dist --no-scripts to merge the upgrade.

Laravel and AngularJS Starter Application

This is a repo for a starter application for a Single Page Application featuring the modern Laravel PHP framework and Googleโ€™s acclaimed front-end framework AngularJS. Just download and install and you have a good foundation for building any application.

Features!

  • Single Page Application
    • HTML5 mode URLs
    • Optimized Laravel and AngularJS routes
      • You kind of donโ€™t need to care about routes, they work automatically as you add new views. Still allows for flexibility if you plan any special routes.
  • Authentication!
  • Laravel Elixir readily configured
    • Versioning of CSS and JS files (cache busting)
    • CSS and JS files will be included automatically
  • A whole ready CRUD architecture
  • Comes with Bootstrap and AngularJS configured to work together at their best
  • And more... have a try!

Installation

git clone https://github.com/Zemke/starter-laravel-angular.git
composer install --prefer-dist
npm install

Database setup

Edit .env.example according to your environment and save as .env. An application key can be generates with the command php artisan key:generate.

Run these commands to create the tables within the database you have already created.

php artisan migrate:install
php artisan migrate:refresh

If you get an error like a PDOException try editing your .env file and change DB_HOST=localhost to DB_HOST=127.0.0.1. If that doesnโ€™t work, file an issue on GitHub, I will be glad to help. Source: http://stackoverflow.com/a/20733001

Run

To provide the JS and CSS files and to keep track of changes to these files:

gulp && gulp watch

To start the PHP built-in server:

php -S localhost:8080 -t public/

Now you can browse the site http://localhost:8080. ๐Ÿ™Œ

Requirements

  • PHP >= 5.4
  • Composer
  • Gulp
  • NPM
  • MySQL

Heroku deployment

Unignore some files

You should remove .env and composer.lock from .gitignore.

.env

Set up your .env file like described in โ€œDatabase setupโ€ above.

Heroku buildpacks

You will need to add custom buildpacks for Heroku. Create .buildpacks and paste:

https://github.com/heroku/heroku-buildpack-php
https://github.com/heroku/heroku-buildpack-nodejs

Procfile

web: vendor/bin/heroku-php-apache2 public/

NPM config

Your package.json should be changed to this:

{
    "private": true,
    "devDependencies": {
        "gulp": "^3.8.8"
    },
    "dependencies": {
        "laravel-elixir": "^3.0.0",
        "gulp": "^3.8.8"
    },
    "scripts": {
        "postinstall": "gulp"
    }
}

The scripts postinstall part is the important here, this will generate the resources like JS and CSS files.

Have fun! Any feedback is welcome. Use Issues or Twitter. My Twitter handle is @FlorianZemke. Iโ€™m looking forward to talk to you.

Laravel AngularJS

Comments
  • Sign Up or Sign In doesn't return a user object.

    Sign Up or Sign In doesn't return a user object.

    Hi, I noticed on my local server, when ever i create a new user, the user object from the server is not returned. Same thing when I sign in or create a new todo item. After creating a todo item, i see undefined in the url /todos/view/undefined. I'm pretty new to angularjs and I want to use this as starting point to learn angularjs + laravel. Can someone help me out here, i don't know what to do?

    opened by elsopi 10
  • Something wrong with Elixir

    Something wrong with Elixir

    I try perfectly and exactly as you write but I got an issue like this..

    file_get_contents(C:\xampp\htdocs\lvmaster\public/build/rev-manifest.json): failed to open stream: No such file or directory
    

    Can you give me a shot to solve this?

    opened by husnulhamidiah 6
  • Problems with elixir after fresh install ?

    Problems with elixir after fresh install ?

    Hey, I'm a big newbie, and I've been trying to find some bootstrap project that would help me start, and I figured this is could be perfect, yet I ran into some problems, if you would be kind enough to explain, that would be amazing:

    1. Fresh install - do instructions, try running gulp, I get:

    Image of err1

    Try adding these files manually: resources/assets/style.css works if I add it myself

    These two I don't know how to do, they are mistakenly being looked for in assets directory, when they are just in js directory:

    File not found: resources/assets/js/app.js File not found: resources/assets/js/appRoutes.js

    Should be like:

    resources/js/app.js resources/js/appRoutes.js

    If I try to add this myself: File not found: public/js/all.js

    It disappears after running gulp

    Because of these gulp tasks not running I get an error when I try to serve the app :

    Image of err2

    Or am I doing something wrong? I swear I tried instructions 3 times (also, "php -S localhost:8080 -t public/" is not working - for me at least only "php -S localhost:8080 -t public" (without the "/") works. Php artisan serve returns same error. I'm running windows 7 64bit

    Any help?

    opened by Vvaltz 6
  • Cannot find module 'detective'

    Cannot find module 'detective'

    $ gulp module.js:339 throw err; ^

    Error: Cannot find module 'detective' at Function.Module._resolveFilename (module.js:337:15) at Function.Module._load (module.js:287:25) at Module.require (module.js:366:17) at require (module.js:385:17) at Object. (C:\Users\Aios\laradock\laravel\node_modules\laravel-elixir\node_modules\browserify\node_modules\module-deps\index.js:6:17) at Module._compile (module.js:435:26) at Object.Module._extensions..js (module.js:442:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:311:12) at Module.require (module.js:366:17) at require (module.js:385:17)

    opened by ghost 5
  • Authentication - Restricting access to Routes

    Authentication - Restricting access to Routes

    Hi

    Thank you for the great starter app. I am working with this and note that I cannot see an example of a restricted API route. I have tested the 'middleware' => 'auth.basic' which works as expected, but I am struggling to use token based authentication to restrict API routes with for example 'jwt.auth'.

    app \ routes.php

    Route::group(array('prefix' => 'api/', 'middleware' => 'jwt.auth'), function () {
        Route::resource('todo', 'TodoController');
    });
    

    app \ Kernal.php

        protected $routeMiddleware = [
            'auth' => 'Todo\Http\Middleware\Authenticate',
            'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
            'guest' => 'Todo\Http\Middleware\RedirectIfAuthenticated',
            'jwt.auth' => 'Tymon\JWTAuth\Middleware\GetUserFromToken',
            'jwt.refresh' => 'Tymon\JWTAuth\Middleware\RefreshToken',
        ];
    

    However the default responses from jwt.auth are not handled by the AngularJS interceptor well. I plan on using my own middleware with the responses set out in a format which works with the Todo app, but any other ideas on approaching this would be gratefully received.

    Many thanks

    Tim

    opened by spirant 4
  • Latest elixir expects css and js to be in resources/assets

    Latest elixir expects css and js to be in resources/assets

    Elixir changed the default assetsDir and since package.json allows any version of larave-elixir, starter-laravel-angular is broken until you move css and js into resources/assets, or pin laravel-elixir to an older version.

    opened by jaden 4
  • RuntimeException in compiled.php line 7051:

    RuntimeException in compiled.php line 7051:

    No supported encrypter found. The cipher and / or key length are invalid.

    in compiled.php line 7051
    at EncryptionServiceProvider->Illuminate\Encryption\{closure}(object(Application), array()) in compiled.php line 1289
    at Container->build(object(Closure), array()) in compiled.php line 1242
    at Container->make('encrypter', array()) in compiled.php line 1780
    at Application->make('Illuminate\Contracts\Encryption\Encrypter') in compiled.php line 1334
    at Container->resolveClass(object(ReflectionParameter)) in compiled.php line 1318
    at Container->getDependencies(array(object(ReflectionParameter)), array()) in compiled.php line 1304
    at Container->build('Illuminate\Cookie\Middleware\EncryptCookies', array()) in compiled.php line 1242
    at Container->make('Illuminate\Cookie\Middleware\EncryptCookies', array()) in compiled.php line 1780
    at Application->make('Illuminate\Cookie\Middleware\EncryptCookies') in compiled.php line 9614
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in compiled.php line 2982
    at CheckForMaintenanceMode->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9614
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in compiled.php line 9604
    at Pipeline->then(object(Closure)) in compiled.php line 2254
    at Kernel->sendRequestThroughRouter(object(Request)) in compiled.php line 2237
    at Kernel->handle(object(Request)) in index.php line 53
    

    I should add that I am new at this like started yesterday new.....

    opened by caveman-uwi 3
  • Hi! Im getting some issues with Tymon JWT

    Hi! Im getting some issues with Tymon JWT

    When I try to login or register i get this error:

    ReflectionException in Container.php line 741: Class Tymon\JWTAuth\Providers\Storage\Illuminate does not exist

    I cloned the repo and added some migrations, seeds and models. I tried composer dump-autoload and verified the app config. Do you have some idea about what can I do? Thanks!

    opened by jonaths 3
  • file_get_contents(/app/public/build/rev-manifest.json): failed to open stream: No such file or directory (View: /app/resources/views/layout.blade.php)

    file_get_contents(/app/public/build/rev-manifest.json): failed to open stream: No such file or directory (View: /app/resources/views/layout.blade.php)

    Hi. I am trying to upload this starter to heroku, and I get this error:

    file_get_contents(/app/public/build/rev-manifest.json): failed to open stream: No such file or directory (View: /app/resources/views/layout.blade.php)

    The program works well offline on Homestead, but when I push the changes to Heroku this error appears. You can check it out at https://dry-lake-8666.herokuapp.com/.

    This is the gulpfile.js

    var elixir = require('laravel-elixir');

    /* |-------------------------------------------------------------------------- | Elixir Asset Management |-------------------------------------------------------------------------- | | Elixir provides a clean, fluent API for defining some basic Gulp tasks | for your Laravel application. By default, we are compiling the Less | file for our application, as well as publishing vendor resources. | */

    elixir(function (mix) { mix .less( 'app.less' ) .styles([ 'style.css' ]) .scripts([ 'libs//*.js', 'app.js', 'appRoutes.js', 'controllers//.js', 'services/__/.js', 'directives/*/.js' ]) .version([ 'public/css/all.css', 'public/js/all.js' ]) .copy( 'public/js/all.js.map', 'public/build/js/all.js.map' ) .copy( 'public/css/all.css.map', 'public/build/css/all.css.map' ); });

    And this are the contents of rev-manifest.json:

    { "css/all.css": "css/all-dd351c50bd.css", "js/all.js": "js/all-ee8c46d8d5.js" }

    Do you know how can I fix it?

    opened by jonaths 3
  • installation error.

    installation error.

    Hi, when i am going to install your application it gives error: file_get_contents(E:\wamp\www\starter-laravel-angular\public/build/rev-manifest.json): failed to open stream: No such file or directory (View: E:\wamp\www\starter-laravel-angular\resources\views\layout.blade.php)

    node is installed npm is installed but gulp is not found. please guide me to make it. Thanks

    opened by tapas4you 3
  • Trouble changing the namespace

    Trouble changing the namespace

    Hello,

    First, thank you for this excellent starter kit!

    I'm trying to change the namespace after cloning the repo, running composer install, npm install, gulp, etc., but I keep getting a fatal error: Class 'App\User' not found

    I'm using homestead and I can get everything working beautifully, but as soon as I do "php artisan app:name App" - I get the Class no found error.

    Any idea what's going on here? I see that you changed the namespace from tel to 'Todo' a couple months ago, how can I go about doing this?

    Kind Regards,

    Nikesh.

    opened by nikeshbhagat 3
  • No protected route found

    No protected route found

    I gone through the application, I like it over all, but I don't found any protected route in the app, All route are public, so what is meaning of login procedure ?

    opened by AdiechaHK 0
  • Creating a new MVC?

    Creating a new MVC?

    I was wondering what is the basic process too creating a new MVC / table to work in the same way as your todo with the API and page routeing?

    Say a posts controller / modal and views with the angular routeing included?

    I tried the normal route by copyings the MVC of the todos and manually created the table but I suspect this is wrong. It hasn't created the angular controllers, something now I suspect gulp does? I have never used gulp before.

    Thanks

    opened by elogicmedia 1
  • Todo List for each user

    Todo List for each user

    Hey There,

    Really glad to find this repo. I was wondering if we could add a boiler plate so that when a user creates a to-do list, he/she would be the only one able to view it.

    Currently, all users could see all todos. I am newbie in laravel, however, I would appreciate if I could get some help there too :)

    idea 
    opened by jaypatel512 1
  • Bower ?

    Bower ?

    Hi,

    This issue is just an idea for future releases to make the starter kit more flexible.

    Bootstrap is "pre-packaged" in your app, so when we clone your repo we will have a specific version of bootstrap you choose.

    Why not using Bower to install it after cloning, and write an Elixir recipe to handle it from where it's installed ?

    source : http://www.codeheaps.com/php-programming/creating-website-using-laravel-5-elixir-assets/

    Thanks for your work :)

    idea 
    opened by prigal 5
Owner
Florian Zemke
Save the nature!
Florian Zemke
The Laravel Boilerplate Project - https://laravel-boilerplate.com

Laravel Boilerplate (Current: Laravel 8.*) (Demo) Demo Credentials Admin: [email protected] Password: secret User: [email protected] Password: secret Offici

Anthony Rappa 5.4k Jan 4, 2023
Modular Laravel - Boilerplate project starter

MODULAR About Modular Laravel This project is a personal blueprint starter with customized modular / SOA architecture. Kostadin Keljtanoski Install Yo

Kostadin Keljtanoski 41 Nov 21, 2022
Laravel Boilerplate / Starter Kit with Gentelella Admin Theme

Laravel Boilerplate Project Laravel Boilerplate provides a very flexible and extensible way of building your custom Laravel applications. Table of Con

Labs64 848 Dec 28, 2022
Get started with Laravel 5.3 and AngularJS (material)

Laravel 5.3 Angular Material Starter Demo An online demo is available. Angular (2+) update While this starter used to be an excellent starting point f

Jad Joubran 1.7k Dec 14, 2022
Laravel Quick-Start - a boilerplate for Laravel Application with typical packages preinstalled and configured

Laravel Quickstart is a boilerplate for Laravel Application with typical packages preinstalled and configured to extend a full-fledged application. We tried to make it as minimal as possible.

Vijay Goswami 18 Sep 8, 2022
This template repository is a boilerplate setup for a PHP application

PHP_Docker Repository Template What is this ? This template repository is a boilerplate setup for a PHP application. Its current version ships with PH

Kevin Richard 0 Jul 16, 2022
Laravel Framework 5 Bootstrap 3 Starter Site is a basic application with news, photo and video galeries.

Laravel Framework 5.1 Bootstrap 3 Starter Site Starter Site based on on Laravel 5.1 and Boostrap 3 Features Requirements How to install Application St

null 900 Dec 22, 2022
๐Ÿ‘” Enterprise Web application starter kit or template using Laravel

Laravel Enterprise Starter Kit (LESK) Description LESK, is a template project based on the Laravel LTS, combining a set of features that can kick star

Sebastien Routier 1 Dec 31, 2020
An implementing of the Laravel Breeze application / authentication starter kit frontend in Next.js

Windmill with Laravel Breeze as Backend API Introduction This repository is an implementing of the Laravel Breeze application / authentication starter

ROKET ID 17 Nov 18, 2022
Phalcon 3, PHP7, Docker sample starter application

Phalcon Docker Nginx starter app Docker image based on: Ubuntu 16.04 Phalcon 3 PHP 7 Nginx + PHP FPM Supervisord Dependencies Docker. For installation

Guilherme Viebig 25 Oct 7, 2022
CodeIgniter 4 Application Starter

Tensaran-Inventories merupakan website pendataan inventaris di desa Tensaran yang saya buat untuk memudahkan pendataan inventaris di kantor desa Tensaran. Aplikasi ini saya buat untuk memenuhi program kerja Kuliah Kerja Nyata (KKN) 2022

Fikrul Akhyar 1 Aug 18, 2022
A Laravel 8 and Vue 3 SPA boilerplate using tailwind styling and sanctum for authentication :ghost:

Laravel Vue Sanctum SPA Laravel and vue spa using tailwind (laravel/ui looks) for styling and sanctum for authentification Features Laravel 8 Vue + Vu

Hijen EL Khalifi 62 Dec 5, 2022
Laravel 8 boilerplate in docker-compose with Treafik and SSL setup and github workflow ready for CI/CD pipeline

Laravel8 boilerplate Laravel 8 boilerplate in docker-compose with Treafik and SSL setup with .github workflow ready To start the containers in prod en

Tej Dahal 5 Jul 9, 2022
LaraAdmin is a Open source Laravel Admin Panel / CMS which can be used as Admin Backend, Data Management Tool or CRM boilerplate for Laravel with features like Advanced CRUD Generation, Module Manager, Backups and many more.

LaraAdmin 1.0 LaraAdmin is a Open source CRM for quick-start Admin based applications with features like Advanced CRUD Generation, Schema Manager and

Dwij IT Solutions 1.5k Dec 29, 2022
A Laravel 5 package that switchs default Laravel scaffolding/boilerplate to AdminLTE template and Pratt Landing Page with Bootstrap 3.0

AdminLTE template Laravel package A Laravel package that switch default Laravel scaffolding / boilerplate to AdminLTE template with Bootstrap 3.0 and

Sergi Tur Badenas 1.8k Jan 3, 2023
A simple and clean boilerplate to start a new SPA project with authentication and more features from fortify

A simple and clean boilerplate to start a new SPA project with authentication and more features from fortify. Its like the little sister of Jetstream, but as SPA.

Tobias Schulz 11 Dec 30, 2022
:elephant: A Laravel 6 SPA boilerplate with a users CRUD using Vue.js 2.6, GraphQL, Bootstrap 4, TypeScript, Sass, and Pug.

Laravel Vue Boilerplate A Laravel 6 Single Page Application boilerplate using Vue.js 2.6, GraphQL, Bootstrap 4, TypeScript, Sass and Pug with: A users

Alefe Souza 533 Jan 3, 2023
Laravel 5 boilerplate with front-end and back-end support

Laravel 5 Boilerplate with Skeleton framework Skeleton (as of now) Laravel 5 framework application. Application includes and/or are currently being us

Robert Hurd 40 Sep 17, 2021
Laravel and Nuxt.js boilerplate

Laravel + Nuxt.js Boilerplate Now supporting Nuxt v3 Examples on using Dark Mode, authentication, and listing data What is included NUXT v3 front end,

Fume 415 Jan 4, 2023