Giter Site home page Giter Site logo

end-to-end-with-angularjs's Introduction

Hi there, I'm Dave Mosher 👋🏻

davemo on a wakeboard

I'm a 🇨🇦 Full-Stack Engineer

  • 📍 Based in Kemptville, ON
  • 👨🏼‍💻 I love JavaScript, Svelte, Devops, CSS and just about everything in between!
  • 💼 Currently working for Clerk, building complete user management tools.
  • ⚡ Fun fact: I can do a pretty good Donald Duck voice.
  • 🤔 You can read what I'm thinking about on my blog.
  • 🎶 I compose and upload music on bandcamp and soundcloud.

end-to-end-with-angularjs's People

Contributors

andrewmclagan avatar davemo avatar royedc4 avatar veeracs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

end-to-end-with-angularjs's Issues

Installation instructions - step 5 seems redundant (and causes an error)

Hi Dave,

This is a minor one (and probably related to #2) - it seems like you've added a session table migration file, so if you do as suggested in step 5 in the installation instructions you'll end up with two identical migration files for the sessions table, which causes an error when you run artisan migrate.

No biggy, but might save someone a few seconds worth of debugging :)

Thanks for the great tutorial!

Regards
Mike

Auth::user() session not maintain in every page

I have used your code for my project but I have found one issue that Laravel session not maintain in every page.
When user login it use Auth::attempt() method and after success it also return Auth:user() data.
But in second controller it does not work.
Please help me to resolve this issue.

Newer Laravel versions break authentication

There seem to be a problem with the authentication portion.

When trying to log-in, I get an error 500 from the server with this response:

{
   "error":{
      "type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException",
      "message":"Class User contains 3 abstract methods and must therefore be declared abstract or implement the remaining methods (Illuminate\\Auth\\UserInterface::getRememberToken, Illuminate\\Auth\\UserInterface::setRememberToken, Illuminate\\Auth\\UserInterface::getRememberTokenName)",
      "file":"\/var\/www\/test\/end-to-end-with-angularjs\/app\/models\/User.php",
      "line":66
   }
}

After following the instructions on the laravel docs at: http://laravel.com/docs/upgrade#upgrade-4.1.26

Everything works.

html5Mode doesnt seem to work

Tried to inject the locationProvider in the run block & an App::missing method so that any 404 fallsback to the index or home route. But the flash doesnt seem to work nor the sessions. How do we get this running ? Am I missing something out here ? Do we have to do something with the .htaccess file which comes with laravel ?

DB Migration for the sessions table missing

Hi Dave, I'm working through your second screencast now (end to end with angularjs) and it seems like the screencast has two migration scripts (one for the users table, and one for the sessions table) however the sample files provided only have the migration script for the users table.

Thanks again for the immensely helpful tutorials!

Ivan

"Follow the linking instructions for php55 that you see in brew info php55"

Thanks for the excellent screencast!

However, I'm confused - which instructions in particular are the "linking" ones?

for reference this is my output for brew markdown php55:

$ brew info php55
php55: stable 5.5.12, HEAD
http://php.net
/usr/local/Cellar/php55/5.5.12 (492 files, 38M) *
  Built from source
From: https://github.com/josegonzalez/homebrew-php/commits/master/Formula/php55.rb
==> Dependencies
Required: freetype ✔, gettext ✔, jpeg ✔, libpng ✔, unixodbc ✔, homebrew/dupes/zlib ✔
Optional: gmp ✘
==> Options
--homebrew-apxs
    Build against apxs in Homebrew prefix
--with-apache
    Enable building of shared Apache 2.0 Handler module, overriding any options which disable apache
--with-cgi
    Enable building of the CGI executable (implies --without-apache)
--with-debug
    Compile with debugging symbols
--with-fpm
    Enable building of the fpm SAPI executable (implies --without-apache)
--with-gmp
    Build with gmp support
--with-homebrew-curl
    Include Curl support via Homebrew
--with-homebrew-libxslt
    Include LibXSLT support via Homebrew
--with-homebrew-openssl
    Include OpenSSL support via Homebrew
--with-imap
    Include IMAP extension
--with-intl
    Include internationalization support
--with-libmysql
    Include (old-style) libmysql support instead of mysqlnd
--with-mssql
    Include MSSQL-DB support
--with-pdo-oci
    Include Oracle databases (requries ORACLE_HOME be set)
--with-pgsql
    Include PostgreSQL support
--with-phpdbg
    Enable building of the phpdbg SAPI executable (PHP 5.4 and above)
--with-thread-safety
    Build with thread safety
--with-tidy
    Include Tidy support
--without-bz2
    Build without bz2 support
--without-mysql
    Remove MySQL/MariaDB support
--without-pcntl
    Build without Process Control support
--without-pear
    Build without PEAR
--HEAD
    install HEAD version
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php5_module    /usr/local/opt/php55/libexec/apache2/libphp5.so

The php.ini file can be found in:
    /usr/local/etc/php/5.5/php.ini

✩✩✩✩ PEAR ✩✩✩✩

If PEAR complains about permissions, 'fix' the default PEAR permissions and config:
    chmod -R ug+w /usr/local/Cellar/php55/5.5.12/lib/php
    pear config-set php_ini /usr/local/etc/php/5.5/php.ini

✩✩✩✩ Extensions ✩✩✩✩

If you are having issues with custom extension compiling, ensure that
you are using the brew version, by placing /usr/local/bin before /usr/sbin in your PATH:

      PATH="/usr/local/bin:$PATH"

PHP55 Extensions will always be compiled against this PHP. Please install them
using --without-homebrew-php to enable compiling against system PHP.

✩✩✩✩ PHP CLI ✩✩✩✩

If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc,
~/.zshrc, ~/.profile or your shell's equivalent configuration file:

      export PATH="$(brew --prefix homebrew/php/php55)/bin:$PATH"

To have launchd start php55 at login:
    ln -sfv /usr/local/opt/php55/*.plist ~/Library/LaunchAgents
Then to load php55 now:
    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php55.plist

Including CSRF_TOKEN when using lineman

Hey Dave, quick question mate hope you don't mind. How would I include the CSRF Token provided by Laravel into my lineman angular app? Obviously the index page is index.us so it's not PHP and you can't simply echo the token out into the document head. I'm sure you've solved this so thought i'd ask you first.

I probably should add that my project structure is like this:

project
|__front-end
|__back-end

Maybe it would be easier to inject the token if it was like this:

project
|__back-end (laravel)
|____public
|______(angular front-end files)

Also might be worth noting that in development, lineman serves from the generated folder. I'm working on a good solution and i'll post results in a blog post.

Prevent the access to home.html if user is not logged in.

First of all great Video! (http://www.youtube.com/watch?v=hqAyiqUs93c)

I want to point out that a not logged in user can still access the home.html directly.
And it would be quite easy for an attacker to patch the JavaScript and access it without a proper login.

I think that you should also verify the User on the Server and only serve the home.html if the user is logged in.

Than we could even simplify the AuthService by using the result of the XHR to home.html

Thanks for you great work.
Fabrice

Accessing the laravel routes using restangular.

I'm using laravel for back-end and restangular for front-end.

my restangular service:

_this.getResignationType = function (id) {
return Restangular.one('laravel_route/'+id).get();

};

my laravel route:

'laravel_route/{id}' => [
'before' => 'auth',
'as' => 'api.laravel_route.initSomeFunction',
'uses' => 'LaravelController@initSomeFunction'
],

Question:
i can't access the routes of laravel, i mean error says, i'm unauthorized to access it. i think restangular can authorized it. i try CORS and restangular.withConfig() but it doesn't work. any suggestion in my case? sorry if it's too far for a issue in restangular, i just need some help. thanks.

composer install error

Hello, I am following your instructions to use this project:
1-clone this repo: git clone https://github.com/davemo/end-to-end-with-angularjs.git
2-install composer dependencies composer install
3-create a database called laravelapp
4-create your unique security key php artisan key:generate
5-run database migrations php artisan migrate
6-seed the database php artisan db:seed
7-run the app php artisan serve
8-browse to http://localhost:8000 and log in with email [email protected] and password admin

But when I run the command "composer install", I get this error:
Mac-mini-de-Soluciones-2:end-to-end-with-angularjs simorg$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)

  • Installing psr/log (dev-master a78d650)
    Loading from cache
  • Installing monolog/monolog (dev-master ec39618)
    Loading from cache
  • Installing filp/whoops (1.0.7)
    Loading from cache
  • Installing nikic/php-parser (0.9.x-dev ef70767)
    Loading from cache
  • Installing jeremeamia/superclosure (1.0.1)
    Loading from cache
  • Installing doctrine/lexer (dev-master 83893c5)
    Loading from cache
  • Installing doctrine/annotations (dev-master 6a6bec0)
    Loading from cache
  • Installing doctrine/collections (dev-master 8c5148e)
    Loading from cache
  • Installing doctrine/cache (dev-master f7a1d66)
    Loading from cache
  • Installing doctrine/inflector (dev-master 64de2fe)
    Loading from cache
  • Installing doctrine/common (dev-master 559a805)
    Loading from cache
  • Installing doctrine/dbal (2.4.x-dev f15c482)
    Loading from cache
  • Installing symfony/translation (2.3.x-dev 638d6e0)
    Loading from cache
  • Installing symfony/routing (2.3.x-dev 22ee195)
    Loading from cache
  • Installing symfony/process (2.3.x-dev 0434822)
    Loading from cache
  • Installing symfony/debug (2.3.x-dev 9760bae)
    Loading from cache
  • Installing symfony/http-foundation (2.3.x-dev c8f7e5c)
    Loading from cache
  • Installing symfony/event-dispatcher (2.3.x-dev 3e0b837)
    Loading from cache
  • Installing symfony/http-kernel (2.3.x-dev 17bb005)
    Loading from cache
  • Installing symfony/finder (2.3.x-dev fc25dab)
    Loading from cache
  • Installing symfony/dom-crawler (2.3.x-dev 64b9087)
    Loading from cache
  • Installing symfony/css-selector (2.3.x-dev a8826cf)
    Loading from cache
  • Installing symfony/console (2.3.x-dev e593294)
    Loading from cache
  • Installing symfony/browser-kit (2.3.x-dev 6a403ee)
    Loading from cache
  • Installing swiftmailer/swiftmailer (v5.0.3)
    Loading from cache
  • Installing predis/predis (0.8.x-dev 4123fcd)
    Loading from cache
  • Installing patchwork/utf8 (v1.1.25)
    Loading from cache
  • Installing nesbot/carbon (1.13.0)
    Loading from cache
  • Installing ircmaxell/password-compat (1.0.x-dev 1fc1521)
    Loading from cache
  • Installing symfony/filesystem (dev-master 7d97789)
    Loading from cache
  • Installing classpreloader/classpreloader (1.0.2)
    Loading from cache
  • Installing laravel/framework (4.0.x-dev 7be5f82)
    Loading from cache

monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing raven/raven (Allow sending log messages to a Sentry server)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing videlalvaro/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
symfony/translation suggests installing symfony/config ()
symfony/translation suggests installing symfony/yaml ()
symfony/routing suggests installing symfony/config ()
symfony/routing suggests installing symfony/yaml ()
symfony/debug suggests installing symfony/class-loader ()
symfony/event-dispatcher suggests installing symfony/dependency-injection ()
symfony/http-kernel suggests installing symfony/class-loader ()
symfony/http-kernel suggests installing symfony/config ()
symfony/http-kernel suggests installing symfony/dependency-injection ()
predis/predis suggests installing ext-phpiredis (Allows faster serialization and deserialization of the Redis protocol)
Writing lock file
Generating autoload files
{"error":{"type":"ErrorException","message":"Undefined index: timezone","file":"/Applications/MAMP/htdocs/end-to-end-with-angularjs/vendor/laravel/framework/src/Illuminate/Foundation/start.php","line":154}}Script php artisan optimize handling the post-install-cmd event returned with an error

[RuntimeException]
Error Output:

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]

Mac-mini-de-Soluciones-2:end-to-end-with-angularjs simorg$

May you help me?

Passing the Credentials static

Is there a secure way to passing the credentials to the api as constant?

I try

$http.defaults.headers.common['Authorization'] = 'Basic username:password';

and i try to send them with the resource header, But this doenst work, too.

update data provided by a service

hi i have an app which has a static data "lets say users" provided by a service and 2 controllers one for view users and another to add new user.
what i'm trying to do is when the user added successfully i want to update the list of users and i am getting this error $digest already in progress

many thanks in advance :)

here is my code

var app = angular.module('usersApp',[]);
app.factory("myusers", function() {
    return {
        set : function(users){users_arr = users;},
        get : function(){return users_arr;}
    };
});

app.factory('form',function($http,myusers){
    return {
        save : function(scope,url){
            var response = $http.post(url, scope.user);
            response.success(function(res){
                myusers.set(res.users);
                scope.$apply(); // here i get the error :)
            });
        }
    }
});

app.controller('ViewController',function($scope,myusers){
    $scope.myusers = myusers.get();
});

app.controller('AddController',function($scope,$http,form){
    $scope.save = function(){
        form.save($scope,'/account/users');
    }
});

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.