Category Archives: laravel

Removing hash from URL Laravel-Vue

The hash (#) in the url is there to support older browsers so if you need to support older browsers you best not remove it. To move to a cleaner URL structure we need to use the HTML 5 History mode by adding mode: ‘history’ to your router. const router = new VueRouter({ routes, mode:… Read More »

Vue Router in Laravel

To use the view router we need to tell laravel that everything we need to route that’s not to the api needs to be taken care of through the Vue router. In your routes/web.php add Route::get(‘/{prms?}’, function () { return view(‘welcome’); })->where(‘prms’, ‘^(?!api\/)[\/\w\.-]*’); This tells laravel to consider everything after the forward slash as a… Read More »

Laravel authorisation

php artisan make:auth is now deprecated… however it’s a simple fix. Instead of using $ php artisan make:auth We need to use: $composer require laravel/ui –dev $ php artisan ui vue –auth $ php artisan migrate $ npm install $ npm run dev

Helper methods in Laravel

Rails gives you a great helper framework for each controller, allowing you to keep the logic out of the view, wanting to replicate but looks like Laravel takes a different approach. First create a helper file in the root of the app $ touch helper.php Now add the following namespace App\Helpers; class Helper { public… Read More »

Partials in Laravel

As a rails developer you have DRY (Don’t Repeat Yourself) drilled into you from the outset – and one of the great tools are partials. No doubt just scratching the surface with Laravel and navigating my way around partials.I tend to have a shared directory for cross app reusable code, so created the directory and… Read More »

Static Pages

There’s pretty much always a need to some standard static pages and I usually create a home, about, contact (with form), FAQ and blog The rails command for this is $ rails g controller Pages home about contact faq blog Translating to laravel we have $ php artisan:make controller Pages We don’t have the capability… Read More »

Postgresql with Laravel

I love Postgres and it comes out the box with Rails however it took some configuring in Laravel. Open up your project in your favourite code editor. Head to the config folder then open the database.php file First off tell the application to use postgresql as the database by changing ‘default’ => env(‘DB_CONNECTION’, ‘mysql’) to… Read More »

Hello, World!

I’m definitely not creating another Hello, World program don’t worry! I’m building out an automated Talent Acquisition platform in Rails and so going to try and walkthrough in PHPL. Not sure how realistic or time consuming it’s going to be but definitely going to give it a whirl! I’ll be using Docker at some point… Read More »

Development Environments

Not really a lot to say here I suppose – I’ve just always liked JetBrains products, I use php storm (php), pycharm (python), Ruby Mine (Rails) & WebStorm (node). If you need something free that does the job you could try Sublime Text, I do my webscraping in this or Visual Studio Code

Getting Started

I need to get out of the ‘it’s easier to do this in rails’ mentality as even setting up the environment I’m thinking ‘I don’t remember it being this fiddly in rails!’ and that’s only installing PHP, Composer, Laravel & Valet! Actually it wasn’t that bad – install homebrew if you haven’t already… (Oh I’m… Read More »