laravel-4

Laravel Migration - Says unknown database, but it is created

╄→尐↘猪︶ㄣ 提交于 2020-01-05 12:08:07
问题 when I use php artisan migrate , i get the error SQLSTATE[42000] [1049] Unknown database 'databaseName' . But the database DOES exists! I even tried going back into terminal, logged into mysql and created the database again, and it said that database already exists! Why is this giving me this error? 回答1: In your app/config/database.php file change the default value from databaseName to a real database name that you are trying to use in your application, something like this (for mysql driver):

Laravel 4 eloquent Mass assignment error in fillable

徘徊边缘 提交于 2020-01-05 10:31:45
问题 I'm currently studying eloquent of L4 and I encountered this mass assignment. I'd follow the instructions and I know you need to setup your $fillable to use the create method but I am still receiving a blank row in the database. here's my code: MODEL: class User extends Eloquent { protected $fillable = array('email','pwd','active','name'); } CONTROLLER: $user = new User; $add = array( 'name'=>Input::get('custname'), 'active'=>1, 'pwd'=>Hash::make(Input::get('pwd')), 'email'=>Input::get('email

Laravel 4 eloquent Mass assignment error in fillable

£可爱£侵袭症+ 提交于 2020-01-05 10:31:37
问题 I'm currently studying eloquent of L4 and I encountered this mass assignment. I'd follow the instructions and I know you need to setup your $fillable to use the create method but I am still receiving a blank row in the database. here's my code: MODEL: class User extends Eloquent { protected $fillable = array('email','pwd','active','name'); } CONTROLLER: $user = new User; $add = array( 'name'=>Input::get('custname'), 'active'=>1, 'pwd'=>Hash::make(Input::get('pwd')), 'email'=>Input::get('email

Apache folder not showing up

情到浓时终转凉″ 提交于 2020-01-05 10:24:13
问题 I'm having trouble with installing a Laravel 4 app on a hosted environment. The problem I'm having at the moment is that the "public" folder is not showing in the listing when going to www.eversite.be/laravel/, can someone tell me why that is, and how can I make it visible. Does this have something to do with Apache, for instance, a permission setting? That would be strange though since I already changed the folder to 777. Apache error log: [Mon Jan 13 17:47:11 2014] [alert] [client 178.116

General error: 1005 when creating a key constraint - Laravel

我是研究僧i 提交于 2020-01-05 08:40:52
问题 When trying to add a foreign key constraint in Laravel I am getting the following error. [PDOException] SQLSTATE[HY000]: General error: 1005 Can't create table 'ts.#sql-5769_62' (errno: 150) I have 2 tables, users and teams . The relationship is teams can have many users and users have one team. Users $table->increments('id'); $table->integer('team_id'); $table->string('name', 255); $table->string('username', 32)->unique(); $table->string('email', 320); $table->string('password', 64); $table-

storing image in a existing table column and display it using laravel 4

馋奶兔 提交于 2020-01-05 08:33:25
问题 I would like to store image in a existing table. How can i do that in laravel 4 .I also want to display that image in my website.How i tried it always shows Call to undefined method Symfony\Component\HttpFoundation\File\UploadedFile::save() . //my show blade @extends ('layouts.default') @section('content') @foreach($posts as $post) <div > <div class="media col-md-8"> <a href="#" class="pull-left paddingTop "> {{ HTML::image($post->image($destinationPath) }} </a> <div> <h3><a href="#"><strong>

Laravel e function (htmlentities) is not fully working, scripts can still be executed (only once)

假装没事ソ 提交于 2020-01-05 08:06:30
问题 I am trying to use the e function in Laravel which is equivalent to the htmlentities PHP function. In my Form view and Controller I am trying to save a document that uses the e function which looks like this: Form view: {{ Form::text('client_name') }} Controller: $client = new Client; $client->client_name = e(Input::get('client_name')); $client->save(); Say I wrote <script type="text/javascript">alert('gotcha!');</script> into the client_name field. I then save it to database but when it

Php artisan serve require fatal error after upgrading php7

陌路散爱 提交于 2020-01-05 05:56:53
问题 After upgrading php from 7.0.14 to 7.0.26 php artisan serve throws this error Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 Fatal error: Unknown: Failed opening required '/Applications/XAMPP/xamppfiles/htdocs/school-dashboard/public/server.php' (include_path='.:') in Unknown on line 0 回答1: Ok, after hours of pulling my hair out I finally found out what the issue was. In laravel 4 php artisan serve does this under the hood <?php namespace Illuminate

Laravel 4 development server crashing without notice

耗尽温柔 提交于 2020-01-05 05:52:14
问题 I am developing an application in Laravel 4 using the built-in development server with a SQLite database. After a recent merge from another user in the project repository, the server will crash after certain requests. I believe I have narrowed it down to a call of Sentry - when it is used on a request the server will crash out and the command line will exit. $ php artisan serve Laravel development server started on http://localhost:8000 Dwight at Dwights-MacBook-Pro.local ~/Sites/tmtbl on

Laravel 4 development server crashing without notice

好久不见. 提交于 2020-01-05 05:52:07
问题 I am developing an application in Laravel 4 using the built-in development server with a SQLite database. After a recent merge from another user in the project repository, the server will crash after certain requests. I believe I have narrowed it down to a call of Sentry - when it is used on a request the server will crash out and the command line will exit. $ php artisan serve Laravel development server started on http://localhost:8000 Dwight at Dwights-MacBook-Pro.local ~/Sites/tmtbl on