Convert your raw SQL statements to a Laravel Query Builder query

If you have some legacy SQL or some raw test SQL code that you want converted into a Laravel’s Query Builder statement, check out Orator. Orator can convert raw SQL into a Laravel Query Builder statement. For example, Orator will convert this SQL query… SELECT * FROM users; … into this Query Builder statement: DB::select(`*`) ->from(`users`) ->get(); I…

Properly display line breaks from a <textarea> using Blade

If you have a <textarea name="content"> field in your form and you use {{ $post->content }} in your Blade template to display the $post->content field, you’ll notice that none of the line breaks are retained when the field is rendered on the page. For example, text entered into a <textarea> like this: The plants…