Comments (11)
I'm also getting this error. Any updates?
from laravel-blog.
In order to resolve this issue you have to:
- First, rollback your previous migration.
- Then, update the migration file present in this folder vendor\fbf\laravelblog\src\migrations
just add this line:
$table->dateTime('deleted_at')->nullable();
- After that run:
php artisan migrate --package=fbf/laravel-blog
- Then in vendor\fbf\laravel-blog\src\models\Post.php
add this line after the namespace declaration:
use Illuminate\Database\Eloquent\SoftDeletingTrait;
And also in the same file add this two lines like that:
class Post extends \Eloquent {
use SoftDeletingTrait;
protected $dates = ['deleted_at'];
....
You should now have something like that:
<?php namespace Fbf\LaravelBlog;
use Illuminate\Database\Eloquent\SoftDeletingTrait;
class Post extends \Eloquent {
use SoftDeletingTrait;
protected $dates = ['deleted_at'];
/**
* Status values for the database
*/
const DRAFT = 'DRAFT';
const APPROVED = 'APPROVED';
....
Now you can run php artisan db:seed --class="Fbf\LaravelBlog\PostTableFakeSeeder"
without problem.
Let me know if that resolve your issue. Thanks
from laravel-blog.
Was having the same problem
Did the above
It works!
Thanks 👍
from laravel-blog.
You're welcome !
from laravel-blog.
After doing the above, I'm getting:
[Illuminate\Database\QueryException]
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.fbf_blog
_posts' doesn't exist (SQL: delete from fbf_blog_posts
)
[PDOException]
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.fbf_blog
_posts' doesn't exist
from laravel-blog.
@singhjay It seems that you are trying to delete a table that doesn't exists.
Maybe you have manually deleted this table without using migrations.
If possible, run this command php artisan migrate:reset
in order to make a reset of your migrations.
After that, you can follow the process described above.
If you still have some issues, you can manually delete all the tables in your database, run php artisan migrate
and follow the process described above.
from laravel-blog.
I didn't create the tables in the first place it seems and I was trying to run the command without noticing. After creating the tables and trying to seed the file, I'm getting:
[BadMethodCallException]
Call to undefined method Illuminate\Database\Query\Builder::withTrashed()
Should I just try everything all over again from scratch?
I'm running Laravel 4.2 by the way on an ec2 instance and when using composer, I used
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.2.*",
"fbf/laravel-blog": "0.7.0"
},
"autol
....
in composer.json
from laravel-blog.
@singhjay You just have to follow the steps that I have described above if you got this error [BadMethodCallException]
Call to undefined method Illuminate\Database\Query\Builder::withTrashed()
from laravel-blog.
Thank you for your time, it worked.
from laravel-blog.
@singhjay You're welcome!
from laravel-blog.
Can we expect to see this fix in a future release? would suck to not be able to update the package because of this...
from laravel-blog.
Related Issues (20)
- updates on administrators backend doesn't work HOT 1
- New Post Small HOT 1
- Configuration not found HOT 8
- Change migration code to generate a migration
- Postgres HOT 4
- thujohn/rss not found HOT 4
- Can the posts be sorted by date published?
- rss package needs updating? HOT 6
- [InvalidArgumentException] Unsupported driver [laravel] HOT 1
- Can't seem to change the way the date is displayed on posts, meta descriptions, etc. HOT 1
- Allow custom attributes in images breaking in PHP 5.3
- installation problems HOT 1
- Can't save with administrator HOT 1
- Installation Error HOT 6
- Messages configuration HOT 2
- Cannot remotely connect to postgres
- Too many redirects
- Laravel 5 support HOT 3
- Laravel 8.x support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-blog.