Coder Social home page Coder Social logo

laravelissues's Introduction

#laravelissues

This is an assortment of errors that I've encountered while learning Laravel and Homestead. I started writing them all down just in case I encounter them again and can't remember what to do. Hopefully this helps anyone trying to learn Laravel and Homestead.

Laravel 4.2

MySQL

Could not stop/restart MySQL56 service in MySQL notifier

This solution fixed it for me

PHP Artisan can't migrate Posts due to access denied 'root'@'localhost'

Set port to 33060 in database config files

Access denied 'root'@'localhost' / could not connect to MySQL

Change the connection port from 3306 to 33060 in MySQL Workbench

Homestead File Mapping

Files would not map to virtual machine specified in src/stubs/Homestead.yaml

Run bash init.sh after every change made to homestead.yaml because it updates ~/.homestead/homestead.yaml which is where the VM really gets its config from.

Laravel doesn't display the welcome page

Set the site mapping to the public directory of where laravel is installed. e.g.

sites:
- map: blog.app
to: /home/vagrant/Websites/blog/public

Error Logging

Error logging won't turn off when setting debug to false in app/config/app.php

Set debug to false in both app/config/app.php AND app/config/local/app.php


Laravel 5.0

MySQL

SQLSTATE[HY000] [2002] Connection refused

Replace '127.0.0.1' to 'localhost' in database config

Migrations

Can not add foreign key to article_tags

Make sure foreign key and primary key have the same data type

Migration not working or something.

Use DB::table instead of Schema::table

Blade Templating

Class Form is not defined

Run composer require "Illuminate/html" in the command line, and add 'Illuminate\Html\HtmlServiceProvider' to service providers in /config/app.php

Form static methods produce escaped output

Use {!! Form::token() !!} to not escape characters. "Illuminate html with V5"

Model binding forms doesn't work

Change 'action' => 'articles.edit' to 'route' => 'articles.edit'

Homestead

Upgraded box Laravel/Homestead and it wouldn't boot up. Deleting the VM in VirtualBox and re-installing the box had no effect.

Not sure why this happened, but deleting ~/VirtualBox VMs/homestead ended up fixing it. This caused data loss in MySQL, however, so I had to re-configure MySQL and re-migrate.

Routing

Page returns text 403 Forbidden

Return true from EditArticleRequest.authorize method, ya dummy.

laravelissues's People

Watchers

James Cloos avatar Anthony Koch avatar

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.