brightstormhq

brightstormhq

Senior Developer for Hire at Bristol

Bristol

Hire Me

Member Since 10 Months Ago

Experience Points 29,150
Experience
Level
Lessons Completed 249
Lessons
Completed
Best Reply Awards 5
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

05 Oct
1 month ago

brightstormhq left a reply on Subscription Renewal

I suspect you are talking about your subscription to laravel Forge? If so you’ll want to pick it up with customer service there not on Laracasts.

30 Sep
1 month ago

brightstormhq left a reply on Protect Against Double Vote On An Article

In the testing laravel series, there is a whole episode dedicated to this https://laracasts.com/series/phpunit-testing-in-laravel/episodes/9 The approach would be to set up a primary key across several fields - in the above episode the likes are set as a morphmany relationship so the primary key uses user_id, likeable_id, likeable_type

brightstormhq left a reply on Better Understanding Of Redis

A good place to start would be to look through the following series https://laracasts.com/series/learn-laravel-and-redis-through-examples

28 Sep
1 month ago

brightstormhq left a reply on Tailwind CSS

@Eddie945 please choose a good comment, so that will help someone find the answer next time, and will let them claim the 'reward' for answering.

brightstormhq left a reply on Tailwind CSS

This Modern CSS for backend developers series covers Tailwind https://laracasts.com/series/modern-css-for-backend-developers

brightstormhq left a reply on Using Vue And Jquery

Just write your jquery in a script block and add to the bottom of your page below where you’ve loaded jquery in your app.js file. As your jquery shouldn’t fire until alp the Dom elements have loaded, calling it at the bottom of the page is fine.

27 Sep
1 month ago

brightstormhq left a reply on How To Put 2 Tables In One Page

Neither of those methods pass the inventories array into your view.

It looks like you are editing an order so you’ll want to reference the order id in your blade rather than inventories.

25 Sep
1 month ago

brightstormhq left a reply on Git Branching Best Practices

An extension to using the feature branch workflow is GitFlow workflow. https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow

"Gitflow is ideally suited for projects that have a scheduled release cycle. This workflow doesn’t add any new concepts or commands beyond what’s required for the Feature Branch Workflow. Instead, it assigns very specific roles to different branches and defines how and when they should interact. In addition to feature branches, it uses individual branches for preparing, maintaining, and recording releases. Of course, you also get to leverage all the benefits of the Feature Branch Workflow: pull requests, isolated experiments, and more efficient collaboration."

19 Sep
1 month ago

brightstormhq left a reply on Laravel: Cache Store [predis] Is Not Defined In Illuminate\Cache\CacheManager.php

youll want to set your cache method to ‘redis’ rather than ‘predis’

brightstormhq left a reply on How I Do Save In Two Db Table With Same Id

Can you add your model files so we can see the relationship between your two tables? I’m curious why you are saving records in 2 tables as you can get whether something is new by the rows updated date. 1900 records in a database isn’t very much. If you are having performance and issues because of this iron these out by reviewing your queries and using laravels eloquent methods to talk to the database and also lazy loading as appropriate.

brightstormhq left a reply on Composer

@davy_yg that’s correct.

17 Sep
1 month ago

brightstormhq left a reply on Seems Slow

I’d look installing a debugging tool such as Tracy https://github.com/recca0120/laravel-tracy which should give you some details on where your bottle neck is. It could also be an issue with your DNS if you app takes ages to respond.

brightstormhq left a reply on Problem With Foreach On Update/save

@petritr can you show your model so i can understand the relationship you've set up? Feels like (if you are using a join table) then you can use sync()

eg

$hub->data()->sync([1, 2, 3]);
16 Sep
2 months ago

brightstormhq left a reply on PHP Storm Laravel Integration

The Phpstorm ide helper package should help here https://github.com/barryvdh/laravel-ide-helper

14 Sep
2 months ago

brightstormhq left a reply on Admin Panel

Laravel backpack has a good crud builder for this purpose https://laravel-backpack.readme.io/docs/getting-started

brightstormhq left a reply on Problem With Foreach On Update/save

It looks like your array is showing a hasMany relationship. Hub has many data. If you define this in your models and set up an appropriate table then eloquent will deal with the save for you. Look at https://laravel.com/docs/5.7/eloquent-relationships for info

brightstormhq left a reply on Modelling Data In Controller Results In: "htmlspecialchars() Expects Parameter 1 To Be String, Array Given"

If you could post whats in your blade file. I suspect you are trying to echo an array.

11 Sep
2 months ago

brightstormhq left a reply on Query Is Takes Only First Id

@mkrahamath you can simplify the above by just setting your

$productIds = [1,2,3,5,6,8];

You are initially declaring a string of numbers and then turning that into an array when you could easily already define the array in the first place

brightstormhq left a reply on Query Is Takes Only First Id

If you are only getting one record when passing in the array, check you actually have products with those ids in your database.

Installing a package such as Tracy will give you access to queries you are running in your UI which will allow scrutinise what’s running at db layer https://packagist.org/packages/recca0120/laravel-tracy

brightstormhq left a reply on Query Is Takes Only First Id

You’ve defined your product ids as a string before passing that string to your query and wrapping it in brackets. Just create the array of ids first, and pass that in.

04 Sep
2 months ago

brightstormhq left a reply on Sample

Can you supply a bit of context / code for this question?

brightstormhq left a reply on Hey Guys. I Need Some Ideas. How Can I Use Javascript To Differentiate $ids Of Objects?

What different thing do you want to happen? Something like a modal pop up or slideshow?

02 Sep
2 months ago

brightstormhq left a reply on Sorry, The Page You Are Looking For Could Not Be Found Error

I’ve not used the action helper instead preferring to create a route in routes.php and then reference the route in the form action. That way you can check the route is valid by running:

php artisan route:list

I think you also might need to post rather than put in your form method.

brightstormhq left a reply on Can't Get Select Value - Laravel 5.5

You’ll only get values in your $request object as a result of a form submission.

If you want to filter your select you’ll need to wrap it in a form and submit a t to you index method which will give you access to the appropriate value you want to filter on

27 Aug
2 months ago

brightstormhq left a reply on Create Vhost Apche2

Don’t forget you can also use the artisan serve to get a local development environment running without needing to touch apache.

brightstormhq left a reply on How To Recover .git Directory?

If you still have the file changes, and the remote repo, just check the project out again and copy your new files over the old and you should see file differences.

Can you clarify what your mean when you say ‘I cant download it again’ - as in you can’t ‘git pull’?

brightstormhq left a reply on Problem With Vhosts

You’ll also need to remove the comments on DocumentRoot so you can server files in the DocumentRoot

26 Aug
2 months ago

brightstormhq left a reply on Recommend Me A Laravel E-commerce Package

The same question was asked last week - https://laracasts.com/discuss/channels/laravel/ecommerce-from-scratch

Assess why you want ecommerce first. If the motivation is to sell products as soon as possible, building an ecommerce solution (and maintaining it) in laravel isn’t the quickest way.

Start with something off the shelf (like shopify) and build up when you’ve got some commercial reason to do so.

24 Aug
2 months ago

brightstormhq left a reply on Show Relation Field On Resource Index

If you have a relationship in User called roles(), then in your index blade, you just need to do the following:

@foreach($users as $user)
{{ $user->roles }}
@endforeach 

You’ll probably want to foreach through roles too to get $roles->name

brightstormhq left a reply on Gitlab

You shouldn’t need to manually upload any files to a new repo. If you have created a new repo locally, by initially running ‘git init’ in your directory and then adding and committing, you should then set a remote

git remote add <remote-name> <url>

Using the path provided by gitlab.

Alternatively clone the remote directory into a new folder locally which will automatically set the remote for you.

22 Aug
2 months ago

brightstormhq left a reply on Laravel Learinig

Watch Jeff’s excellent introduction series to Laravel https://laracasts.com/series/laravel-from-scratch-2017

21 Aug
2 months ago

brightstormhq left a reply on Get Selected Value From Select On Change In Laravel

if you are trying to display the value of the selected option further down the page you don’t need to use Ajax to do this as you can just get the option value using onChange and then set the value via $(‘#foo’).val(optionValue); where #foo is the element containing your php variable.

I’d suspect this is part of a bigger form which will be submitted to the server to store the value of your selected option which it will get from your element.

My advice would be to work out your form login before adding any jquery and then add your jquery as an enhancement to the view otherwise you’ll get caught up in the detail before core functionality is in place.

If you can post some more code including the contents of your blade file and related controller method this will give more context.

19 Aug
2 months ago

brightstormhq left a reply on File_put_contents(...): Failed To Open Stream: No Such File Or Directory - Always This Problem

Your storage folder and all inside should have 755 file permissions. Make sure you add the the -R flag to recursively set inside folders.

brightstormhq left a reply on How To Change Default Webpack.mix Path?

Are you running npm on your host machine or inside your vm?

18 Aug
2 months ago

brightstormhq left a reply on ECommerce From Scratch?

I’d never recommend building ecommerce from scratch. If you really are starting from a clean slate, work out how many products you are planning on selling and build a solution around that. If you are in a hurry to start trading, an off the shelf pay as you go like shopify.com would be my recommendation. You can be up and running in a day and that will buy you some time to establish what you need. If you build custom, you are exposing yourself to a great deal of anguish regarding payment gateway integration, hacking and the like. Unless you have a specific need and are expert at building ecommerce then mitigate your risk by using someone else’s work.

brightstormhq left a reply on Statamic Vs. Laravel Nova

A 3rd contender which acts as CRUD and both CMS is a product called backpack. https://backpackforlaravel.com Pretty straight forward to set up with no additional models required, Deals with user management and permissions too (using Spatie package for permissions)

brightstormhq left a reply on Best Way To Bisect Two Large Collections

If you are only trying to show the items which are not new items, in which case do you only need 1 query where prepared =1?

If you are trying to exclude the new items from all items, then you can add a whereNotIn with an array of the ids you wish to exclude.

13 Aug
3 months ago

brightstormhq left a reply on Join Three Table And Get Specific Data

@armancs you'd be better create the table with a migration file to make it easier to deploy your application.

I'm not sure how your question has changed but i can see the addition of

$countries->country->name

which won't get you anything as there isn't a relationship to country on your $country model.

If you can look at your question again and clarify then i'll have another go at answering,

brightstormhq left a reply on Join Two Table And Get Specific Data

If you use standard Laravel table and field names you’ll have a much easier time getting this to work.

Firstly, your tables don’t need the _tbl suffix - they are already tables in a db.

Your tables can just be ‘countries’ and ‘ universities’

See https://github.com/alexeymezenin/laravel-best-practices/blob/master/README.md#follow-laravel-naming-conventions

Secondly, your ref_country_id should be just country_id. This way you don’t need to define the $fk. Also given you’ve already got region_id in that table, the region_id is also a foreign key so a variable named $fk isn’t the only one.

In your view, if you’ve got a single university you should be able to display the country as such

$country = $university->country->name;

Also, to follow convention, you don’t need to suffix Model onto the end of your model names. Follow conventions, and it’ll make all your dev easier (and much easier for others to debug).

12 Aug
3 months ago

brightstormhq left a reply on Customising Users Table

Where are you storing your state_id and referencing your States data from?

11 Aug
3 months ago

brightstormhq left a reply on Customising Users Table

@flowser first you need to ensure your model relationships correctly reflect what you are trying to achieve. You’ll waste a lot of time and brain working up your controller methods before you have done this mapping,

Let’s us see your User model and migrations and someone can help you with those.

brightstormhq left a reply on Form Submission

@10minutemail what does your store method look like? Also check your route for store isn’t clashing with your route for index. You can do this by running artisan route:list

brightstormhq left a reply on Body Exceeds With Aside Tag

@joffpascual can you add some code formatting into your post above as it’s hard to see what’s going on in your blade.

10 Aug
3 months ago

brightstormhq left a reply on Customising Users Table

As @aurawindsurfing suggested, you need to extend your user model to add state_id and then set up as hasOne relationship with a new model called State. You’ll need to create a migration to d this, if you system is already in product or add the field to the User migration if its not. Should then be straight forward to receive the State name for the id.

brightstormhq left a reply on Where Are You All From?

Just up the road from you in Bristol

08 Aug
3 months ago

brightstormhq left a reply on How To Get Last Id In Laravel?

@Snapey I admire your persistence.

brightstormhq left a reply on How To Get Last Id In Laravel?

To ensure you are acting on the current school, you should set the school_id as a hidden field in your form and then reference that within your store method. Alternatively, if your user has a relationship with a school then you can get this id via Auth::user()