georgek

georgek

Member Since 3 Years Ago

Experience Points 5,810
Experience Level 2

4,190 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 39
Lessons
Completed
Best Reply Awards 0
Best Reply
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.

20 Mar
1 year ago

georgek left a reply on Impossible To Read Relation Data Within Foreach

No problem was I have "orders" field inside customer table to store the total number of orders. So customer->orders return the number 3 which is the field stored in table customers instead of the relation. I changed relation to getorders() and now I have

customers->orders to get the total number of orders and customers->getorders to get the whole related data

georgek left a reply on Impossible To Read Relation Data Within Foreach

Ah ok I got problem, it looks like that I use "orders" as column field as well. So its not correct to use same name for fieldname and relation.

georgek left a reply on Impossible To Read Relation Data Within Foreach

Ok can you forget everything we said and tell me why this happens:

$customers = Customers::with('orders')->get();
return $customers[0]->orders; // returns 2
$customers = Customers::with('orders')->get()->toArray();
return $customers[0]['orders']; // returns array of data (2 records)

georgek left a reply on Impossible To Read Relation Data Within Foreach

@tykus, please see original post I edited. It was mistype here on forum. On my code is "orders".

$customers = Customers::with('orders')->get();
return $customers[0]->orders; // returns 2
$customers = Customers::with('orders')->get()->toArray();
return $customers[0]['orders']; // returns array of data (2 records)

That's insane.

georgek left a reply on Impossible To Read Relation Data Within Foreach

I use class names based on my language. To make it easier to read I changed it to english (Customers and Orders). By mistake I forgot the "s" at the end. This is not my problem, my class names are absolutely perfect. Something else causing the problem.

georgek left a reply on Impossible To Read Relation Data Within Foreach

@tykus, please see original post I edited. It was mistype here on forum. On my code is "orders".

$customers = Customers::with('orders')->get();
return $servers[0]->disks; // returns 2
$customers = Customers::with('orders')->get()->toArray();
return $servers[0]['disks']; // returns array of data (2 records)

That's insane.

georgek left a reply on Impossible To Read Relation Data Within Foreach

that was mistype, I change names to make it simply to display.

I use it as "orders". I still can't get data.

georgek started a new conversation Impossible To Read Relation Data Within Foreach

I have a two models customer and orders. Customer has many orders:

 public function orders() {
        return $this->hasMany(Orders::class);
    }

then I get all data

$customers::with('orders')->get();

foreach($customers as $customer) {

    return $customer; // return all data and orders correctly

        return $customer->order; // it returns a number (count of records)

    return $customer->order(); // return error Object of class Illuminate\Database\Eloquent\Relations\HasMany could not be converted to string


    return $customer->order()->get(); // works but it reads again database although data are already loaded
}

It seems that I cannot find a way to get the order data without reading database again. What am I doing wrong?

02 Feb
1 year ago

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

@Cronix but I had some other servers with Forge with serious sites and web services. Cancelling my whole account blocks access to those servers too. If I had the 10 days notice, I would have the time to move everything to another provider.

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

@ejdelmonico you prepay for the upcoming month. I had already paid until February 24.

http://take.ms/Umwyp

He said he will cancel my account and he will refund. Till now I see only cancellation, he didnt refunded the amount yet.

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

@Cronix

  1. a) Terminating immediately with cause = violating a rule (illegal content on server, illegal activities, hacking etc). No notice here.

b) No cause = we don't have any reason, you dont violating any rule but OK we give you 10 days to pack your things and leave.

I am clearly on the "b" but as I said he didn't respected the 10 days frame.

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

@Cronix you asked me to stop this thread and you keep replying.

  1. I didnt asked for opinion or feedback. As I said I wanted to share my experience in public.

  2. For some people this thread may be helpful so they will consider another provider just in case of 1 out of 1.000.000 that Taylor will decide to push the button again (they say if you do it once, you will do it again).

  3. I provided them all details needes, SSH account to provision the script themselves and the full log file.

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

@wilk_randall it doesnt work like that. in a commercial relationship (customer - business) there are contracts and terms. And for Forge these are the terms:

https://forge.laravel.com/terms

Read the paragraph "Account Cancellation Or Suspension" it doesn't clearly say that Forge can cancel your account anytime for any reason without violating any term. But it says "If at any time it becomes necessary for Laravel Forge to cancel a customer's service without cause, Laravel Forge will provide 10 days advance notice" and this is Taylor's fault.

that will be my last message to you. I think we had enough of this.

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

@topvillas as I said I already moved on to other provider. I am just replying your messages. So we can stop here, no more replies on this thread. I shared my experienced, you judged me and we are good.

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

@divanoli I have sent him again the following:

"I didnt asked you to cancel and refund. Thats my decision not yours. I just asked for support".

(made a typo though I mean Thats your desicion, not mine).

Of course never replied, he made his decision.

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

@Cronix @Talinon I am not looking for an answer. I am not looking for social justice. I dont care if I look worse. I dont really care for your opinion and I don't expect to support me (I didnt asked for).

Is just a public forum with a huge title "Forge" and I wanted to share my experience with Forge: 10 days to reply + no support at all + cancelling my account (which is ridiculous).

Delete my thread? Censorship? Ok, why not ;)

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

@Snapey because it doesn't have any error. Its just a huge log of 4000 lines without any obvious error and the script runs until the end. Swapspace is the last command.

http://take.ms/H7YEv

Why should I debug their script and give them the solution? This is what you do as a customer? You fix problems and you just email them with hotfixes?

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

@Snapey I had more servers with Forge, it just fails on VMware or OpenVZ VPS systems. I never asked for refund, I never asked for any favour. I just asked why I pay 200$ per year.

Forge = Automatic provision of server = 200$/year

If I cannot provision + They dont support WHY should I pay? If they feel they cant or dont want to support, they have to tell: "Sorry we cannot help, Forge is working on specific machines only". After that I had to make my mind, stay or migrate.

On the other hand, if Taylor feels that I insulted him, OK I accept it but I still can't see which term of TOS I have violated plus I cant understand why he didnt respected the 10 days prior notice.

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

@wilk_randall where did you see I dont have server experience? And forge is a service for developers how have knowledge at least basic knowledge of system administration. Forge is not replacing the system administration work, it is automating the server creation (in my case using API). Dont forget that most of tasks still has to be done manually (editing conf files).

The script that provisions the forge service is hosted on their machine and I cannot fix it (and I am not willing to spend hours of fixing for them, this is why I paid = to automatic provision a server, not to fail). They have to fix it so their script will provision the server correctly without hanging to "provision...." for ever.

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

@jlrdw also I dont FTP, its insecure. I always scp. Stop using FTP and more about scp here:

http://www.hypexr.org/linux_scp_help.php

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

@jlrdw I have very good server experience but the reason you pay a service like Forge is to have them automate everything for you and work as advertised.

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

@wilk_randall well he locked me out without any prior notice. This cause me a problem but finally I am moving. I have plenty of options. For the rest here is a list of Forge Alternatives.

https://serverpilot.io/ https://moss.sh https://www.ansible.com/

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

If you read the whole ticket you will see how much times I asked and tried to get support.

I am pretty sure you are the jerk at parties, look at your face LOL

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

@wilk_randall I never said I am the victim. Read again what I say on the title of this thread. He cancelled my account without asking me (or without my request).

@blueshift9 assuming != insulting. As I a customer I can assume and judge. I don't behaving. Is this violating the terms? If you send an email to paypal and you are upset and you assume things they will terminate your account if you dont behave?

@Demers94 it was an exact copy paste there is nothing more or less. On forge site it says: "Or, you can even provision a VPS on the custom provider of your choice.". I can tell you that among the 3 top used VIP virtualizations: KVM, VMWare and OpenVZ it works only to KVM. In my case Its not a custom thing, its VMWare. If you are a developer you should know what VMWare Cloud VMs means.

As long as its a commercial service with "support" icon they have to support. I didn't asked for express custom support. Its the obvious to support what you say "Custom VPS" as long as it runs clean Ubuntu.

Btw, @wilk_randall @blueshift9 @Demers94 I didnt see any comment for the 10 days reply on support request.

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

As you can see I was upset because they didnt want to check the script on my machine. Custom providers and errors in the air.

And this is the second time I have troubles with support. Here on the screenshot you will see that It took 10 days and two emails to have their attention for the obvious: support.

http://take.ms/H7um4

Actually there is no support at all. Forge is just a bunch of pre-made command line scripts (like the ones on Digital Ocean tutorials) and there is absolutely no support of fine tuning to make it compatible in all environments like VMware or OpenVZ.

Taylor is a good developer but not a good system administrator. And of course he doesn't respect his own terms. He didn't even gave me the 10 days notice. As I said the power of "I have the button am the god".

http://www.onalert.gr/image/?w=600&h=315&src=/files/Image/NewOnAlert/USA/TRUMP/donald_trump_red_button.jpg

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

I am unable to provision to a server (VMWare Cloud machine). Can I send you SSH details to see it on your own and fix your issues?

===

Please elaborate, what issues are you facing? What happens when you try to run the provisioning script on your server?

===

It runs and it executes hundred of commands. Some commands may fail at at the end the provision never finishes and on laravel forge panel it says "provisioning" for ever. I run ubuntu 16.04 fresh no services installed. It would be better to check it for yourself and run the script and see where it fails so you can fix your script? I cant understand in which part it fails.

===

If the script fails, can you please share any error messages it outputs?

===

I dont see any error, i just see 1500 different lines. Where should I spot the error?

I run script with > out.txt

in bash you will find that i see after i executed the command and out.txt with the ouput.

Please tell me what's wrong

===

I don't see any errors either but seems like the script didn't finish running on the server, that's why the server isn't provisioned yet. You'll need to check why the script hangs, sometimes it's because server runs out of memory.

===

Server has 2GB RAM, it doesnt run out of memory.

So you dont interest to see it on your own? You dont want to improve your script and make it more compatible ?

===

I was able to run the provisioning script on a 1GB server yesterday and all went well, unless you can provide us with a clear error message that we can debug I won't be able to help, custom providers can have their own way of running scripts so it's really hard to identify what's wrong without feedback.

===

What you mean "custom" providers? its a clean ubuntu 16.04. Why its provider fault and not your fault? You create a script without taking into account various external factors.

For example, its 100% sure that Forge doesnt run on VPS under OpenVPZ because you changing something on swap file and its not allowed o OpenVPZ. And what is your excuse on that? "Custom provider" ?

I feel you just get the setup script from a online tutorial that works and tested in some major systems and then you have no clue how to administer and fix things and make your system compatible with all possible variations of virtualization technologies (like VMWare and OpenVZ). Fixing one possible collision in my VM may fix for other customers too. But seems you cant understand that.

I am trying to figure out why I am paying for your service. For a custom made script taken from an online tutorial? What is the support for? Explain

===

George, it sounds like Forge is not for you. I will refund your subscription and cancel your account. Sorry for the trouble.

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

Taylor contacted me in person to tell me that Forge is not for me and he decided to cancel my account. This is the perfect forum for this as people have to know more about Taylor and Laravel Forge before they trust their servers.

georgek left a reply on Taylor Otwell Cancelled My Account Without Asking Me

https://forge.laravel.com/terms

"If at any time it becomes necessary for Laravel Forge to cancel a customer's service without cause, Laravel Forge will provide 10 days advance notice."

I didnt receive any 10 days advance notice, just the power of "I dont like you, goodbye".

georgek started a new conversation Taylor Otwell Cancelled My Account Without Asking Me

I am so disappointed with Taylor Otwell (Laravel Author). I complaint on their Forge support because my server cannot be provisioned and they were unable to help me at all and he didnt like my way and he used his power to push the button and cancel my account and leave me out of my servers control.

This is embarrassing, ridiculous and so unprofessional.

24 Nov
1 year ago

georgek started a new conversation Tags Relation With 2 Tables Only

I have a model "People" and one more model "PeopleTag". Example records:

People: #1 George #2 Lara #3 John

PeopleTag: #1 - 1 - tall #2 - 1 - male #3 - 1 - friend #4 - 2 - female #5 - 2 - friend #6 - 3 - visitor #7 - 3 - male

What I want is to create a belongstomany relation between them without using a 3rd tables. Normally I had to do it like:

PeopleTag: #1 - tall #2- male #3 - friend #4 - female #5 - visitor

People_PeopleTag: #1 - 1 - 1 #2 - 1 - 2 #3 - 1 - 3 #4 - 2 - 4 #5 - 2 - 3 #6 - 3 - 5 #7 - 3 - 4

But I dont really need to have a 3rd table in that case. Would it be possible to have belongstomany relation with 2 tables only on this example?

11 Oct
1 year ago

georgek started a new conversation A Form With User Details, Roles And Permissions

Hello, three models

User, Role, Permission

with manytomany relation between them. I want to create a form so user can add/edit a user. The form must be like

  1. input elements to edit user details (email, password etc)
  2. checkboxes to check roles
  3. checkboxes to check permissions

My main issue is that I have to display all roles and check only the ones that user has permission. User::with("role") doesn't have because it filters only roles user has. So in order to get all roles and permissions I had to create 2 additional calls and use with to get all users with query (where)

        $user = User::find($id);
        
        $roles = Role::with(['users' => function($query) use ($id) {
            $query->where('user_id', '=', $id)->select('id');
        }])->get();

        $permissions = Permission::with(['users' => function($query) use ($id) {
            $query->where('user_id', '=', $id)->select('id');
        }])->get();        

It will get all roles and when a users relation is null then user hasn't the specific permission and when it has a record then it has the permission. Then in my gui I check this and check or not the specific checkbox.

It works but I feel it's not the proper way. Can you advice me what's the most laravel way?

Thank you

07 Oct
1 year ago

georgek started a new conversation Custom Error-code Blades (404, 500) Inside Package

I have a folder errors inside my resources/views with blades 404.blade.php 500.blade.php etc and it works perfect. I decided to move that in a package. In my package service provider I have:

View::addLocation(__DIR__. '/views');

and inside views folder I have the folder errors. It works perfect for all views I have inside for example "auth" (for login) but when it comes to error 404 it loads the default one from laravel.

06 Oct
1 year ago

georgek left a reply on Preventing Two Users To Update A Model At The Same Time

Well, fooSeat is just a name. Anyone can name anything as they want I dont think it confuses people :)

05 Oct
1 year ago

georgek left a reply on Preventing Two Users To Update A Model At The Same Time

@martinbean the foo is just an example. Well, generally the code is an example, I dont name my classes with "foo". I understand what you say about multiple seats per reservation but in my case I don't need this. Its an one-to-one relation. Its hard to explain why but trust me it works perfect for me now.

Btw, where is the best place to put that code? One way is to add a public static function inside the model. Other way is creating a Trait file. Other way is inside a controller. What's your opinion?

georgek left a reply on Preventing Two Users To Update A Model At The Same Time

@martinbean so, having a relation table in the middle with a unique key as seat_id, mysql will complain and it will not allow any other insertion. an exception will be raised so I can catch it, rollback and inform the user that this seat has a reservation already.

Updated code:

$seatNumber = 22;

// reservation table has a unique field (index, non incremental) seat_id
// it allows only one seat_id number. in order to release the seat later, we just
// delete the record from table

DB::beginTransaction();
try {       
    $reservation = new fooReservation;
    $reservation->seat_id = $seatNumber;
    $reservation->save();    
    // if seat is already reserved it will fail here

    $ticket = new fooTicket;        
    $ticket->cost = 5;
    $ticket->date = new \DateTime();
    $ticket->save();

    fooReservation::where('seat_id', $seatNumber)->update(['ticket_id' => $ticket->id]);
    \DB::commit();          
}
catch (\Exception $e) {
    DB::rollback();    
}

@Snapey thank you for suggestion, I already have in mind to implement lock/expire mechanism but first I need to solve this problem. I think the final implementation is the proper way.

georgek left a reply on Preventing Two Users To Update A Model At The Same Time

about #2. Locked field that expires is an ideal solution when you have multiple steps on the application. In my case you just click one button "Ticket on 22" and it executes the code. So the expire expire mechanism doesnt make sense here.

#3 is impossible in my case. I didnt explain you the entire plan but its not only operators that can book tickets. Also users can book using web or mobile phones. So javascript is not an option here. It should be solved in backend level as I did in my code.

georgek started a new conversation Preventing Two Users To Update A Model At The Same Time

Imagine a bus with seats and a web software allowing operators to sell tickets assigned to seats. I am trying to avoid the case that two operators will sell a ticket for the same bus. I have managed to solve the problem using the following logic, but I was wondering if someone has a better idea.

$status = "unknown";

$seatNumber = 22;

DB::beginTransaction(); try {

$ticket = new fooTicket;        
$ticket->cost = 5;
$ticket->date = new \DateTime();
$ticket->save();

$seat = fooSeat::where('id', $seatNumber);
if ($seat->first()->ticket_id > 0) {
    DB::rollback();
    $status = "already_booked";
}
else {
    $seat->update(['ticket_id' => $ticket->id]);        
    \DB::commit();  
    $status = "completed";
}

} catch (\Exception $e) { $status = "unknown_error"; DB::rollback(); }

echo $status;

17 Aug
1 year ago

georgek left a reply on Access Facades In Session.php And Database.php

I am trying to dynamically update session options like session name etc by reading data from Redis Database or MySQL.

16 Aug
1 year ago

georgek started a new conversation Access Facades In Session.php And Database.php

It seems that I cannot find how to access facades like Cache:: or Redis:: from session.php and database.php. These files are loaded before the app boots. Is it possible to somehow use them inside those two files?

19 May
2 years ago

georgek started a new conversation Possibly Bug When Switching Database Connection

I have this code which works perfect inside controllers:

\DB::connection('database2')->table('demo')->insert( ['one' => '1', 'two' => '2']);

but when I place it inside Kernel.php to run it as schedule

protected function schedule(Schedule $schedule) { $schedule->call(function () {

        \DB::connection('database2')->table('demo')->insert(
            ['one' => '1', 'two' => '2']);

    })->everyMinute(); 
}

it ignores connection database2 and I got the error message:

[Illuminate\Database\QueryException] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'database.demo' doesn't exist (SQL: insert into demo (one, two) values (1, 2))

It tries to find the table "demo" on the default database connection. Is it a bug?

27 Apr
2 years ago

georgek started a new conversation Base Folder Name On URI

I have an application and there are different pages like myapp.com/login myapp.com/orders myapp.com/customers etc

What I want is to have the whole app features but in separate root folders. For example

myapp.com/store1/login myapp.com/store1/orders myapp.com/store1/customers

myapp.com/store5/orders myapp.com/store15/customers etc

How can I create a "root" folder name that is include on a specific list of allowed names like store1, store2, store5, store11, store15?

Thank you

26 Mar
2 years ago

georgek started a new conversation Illegal Mix Of Collations

Laravel gives me an invalid mix of collations which is wrong.

http://take.ms/dpY0U

I have tried to change all tables and fields both to utf8_general_ci and utf8_unicode_ci.

And of course if I run the same query in navicat it works

http://take.ms/xGK9p

I cant understand why this happening. Any idea?

17 Mar
2 years ago

georgek left a reply on Route Getting Content From Other Website

EXACTLY, thats what I want to do. To expose selectively 100 CSS and JS over the 15.000 in total.

anyway thank you for not helping me. I will ask in Stackoverflow.

16 Mar
2 years ago

georgek left a reply on Route Getting Content From Other Website

The reason I am doing this is because the 2nd server is a tomcat application (java) and only accessible localhost (so its probably mine) and I dont want to expose it outside. I am trying to give out to my clients just a small part of the functionality that's why I want this routing.

georgek started a new conversation Route Getting Content From Other Website

I have an html that reads css and js files. But those files actually are not available on my local server, they are available to other server. What I want is to get the content from the other server and serve them to my client. For example when user reads my website.com/contact/index.html that includes css and js like

/contact/css/misc/one.css /contact/js/file.js etc

I want to load those from http://othersite.com/something/css/misc/one.css .... /something/js/file.js

Any help on how I can do it properly with Laravel?

07 Mar
2 years ago

georgek left a reply on Middleware Video For 5.4?

Probably yes but how should a new user know that? It will see a complete video course of 5.4 without getting any idea of Middlewares? Or he has to see the full 5.0 series then the full 5.2 series and then the full 5.4 series? Doesnt make any sense.

georgek started a new conversation Middleware Video For 5.4?

I cannot find where is the laracast video for middlewares in Laravel 5.4. I can only found one for laravel 5.0. Why?

georgek left a reply on [L5] Change Default Database Connection Dynamically.

@uxweb how can I contact you in private?

25 Feb
2 years ago

georgek started a new conversation Laravel Ignores X-CSRF-TOKEN On The Header

I have added the X-CSRF-TOKEN via ajax setup and I can see on the POST request on the section Request Headers

http://take.ms/S4jV3

But I still got a token error from Laravel like ignoring the header entry. Any ideas why?

24 Feb
2 years ago

georgek started a new conversation Laravel And Avoid Hijacking Client-side Scripts.

Hello, is there any article or something you can guide how to secure my laravel app to avoid hijacking my client-side scripts?