Coding Articles

Creating Dummy Articles with the Same User using Laravel Eloquent

If you have set up your Laravel installation with --auth, then you will already have a User class and Factory. Then set up your Factory to create an article, it will look something like this: $factory->define(Article::class, function (Faker $faker) { return [...

Hosting for Laravel Apps (and others)

I have struggled to find a good host for testing my Laravel apps. My existing host I can't use because my sites are on a shared server. So, I have tried AWS and Azure but to no avail, they were too complicated and too expensive and in the end my apps just weren't...

A Simple Create Post Form with Validation

A simple form with basic validation. ArticlesController.php public function store() { //validation request()->validate([ 'title' => 'required', 'body' => 'required' ]); // persist the resource $article = new Article(); $article->title = request('title');...

Laravel: Change Default Error Pages

If you want to replace the default Laravel error pages (e.g. 401, 419, 500) then it's pretty straightforward. All you need to do is create a new folder in the 'views' directory and call it 'errors'. Then create your new error pages and use the following naming...