arthvrian

arthvrian

Member Since 10 Months Ago

Experience Points
7,200
Total
Experience

2,800 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
0
Lessons
Completed
Best Reply Awards
11
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    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 Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

Level 2
7,200 XP
10 Aug
1 month ago

arthvrian left a reply on How To Fix Your Connection Is Not Private Attackers Might Be Trying To Steal Your Information

your SSL certificate expired on August 04 (that's why you get that error)

if you have access to your domain hosting you can renew it

arthvrian left a reply on Strange Things Happening With My Routes

can you post your routes file and your PagesController file?

sounds like you have the auth middleware active somewhere

28 May
3 months ago

arthvrian left a reply on .env Paramaters Doesnt Work

try php artisan cache:clear or php artisan config:clear

21 Feb
7 months ago

arthvrian left a reply on Laravel Mail Does Not Send To Mailtrap

Ok, your config is OK (.env and config/mail.php)

are you trying this from Windows or Linux (localhost)? or in a test server (i.e DO)?

localhost many times does not have sendmail (as said @billriess) in windows did not exists you must install other tools (i don't remember the name); in linux you can run the command wrote by @billriess

arthvrian left a reply on Laravel Mail Does Not Send To Mailtrap

is your .env config equal to the config shows in mailtrap?

arthvrian left a reply on Laravel Mail Does Not Send To Mailtrap

question

did you are checking YOUR email account or your MAILTRAP account?

arthvrian left a reply on Mb_detect_encoding() Expects Parameter 1 To Be String, Array Given

the error is saying what the problem is

$ input is an array, maybe it's the input file?

in mb_detect_encoding you must specify a string as parameter, maybe $ input ['name'] ? to convert

arthvrian left a reply on How To Get Record In Between Range Of Quantity?

orWhere with Parameter Grouping

https://laravel.com/docs/5.7/queries#parameter-grouping

test::where('min', '<=', 16)
            ->where(function ($query) {
                $query->where('max', '>=', 16)
                      ->orWhere('max', null);
            })
            ->get();
20 Feb
7 months ago

arthvrian left a reply on Problem To Create A Print Button In Jquery To Laravel

first of all, the javascript is in a 'external' file (like app.js) o embed in the blade view?

if external this will not work, you cannot 'call' a php function inside a .js file you must insert this in the blade view

19 Feb
7 months ago

arthvrian left a reply on Artisan Command Error

PS = PowerShell (as CMD = command prompt)

why do you need it for?

I think you need put the full path for ps.exe (if you need it on your script task) c:.....\ps.exe

arthvrian left a reply on Edit() And Destroy() Functions Not Working On Shared Hosting

2?

  • in both (users and posts tables) is 2? // !== must work
  • id on user table is 2? // selected posts record must have user_id = 2
  • user_id on posts table is 2? // logged user must have id = 2

arthvrian left a reply on Laracasts Website Doesn't Work In Firefox

Working from here, FF last version

  • did you tried in 'Private Window'?
  • did you tried with add-ons (or ad blocker) disabled?

arthvrian left a reply on Problem To Create A Print Button In Jquery To Laravel

try

var algo = '{{ action([email protected], [ido => ' + id + ']) }}';

arthvrian left a reply on Route Redirect

  • make a hidden div in your HTML with the structure you want
  • fill the div with the given JSON data
  • show the div
success:function(response) {
    $('#IP').html(response.ip);
    ...

    $('div.data').show();
}

arthvrian left a reply on Edit() And Destroy() Functions Not Working On Shared Hosting

I don't know, maybe:

  • different versions of php/mysql
  • different column types in tables (localhost vs production)

in fact, this is not a solution, you must check the datatype of your User and Post, !== must work

arthvrian left a reply on Edit() And Destroy() Functions Not Working On Shared Hosting

correct how?

you have a !== means the type is important (1 !== '1' is true) did you try with != and pass (not redirected)?

arthvrian left a reply on Edit() And Destroy() Functions Not Working On Shared Hosting

make a dump of the data

dump(auth()->user()->id);  
dump($post->user_id);

dump(Auth:user()); // get all the user data

you can try Auth:id() instead of auth()->user()->id

arthvrian left a reply on Radio Button/checkbox Passing The Wrong Value To The Database

n the index method of AnswerController you can put

dump($question);

Before showing the view and after obtaining the questions, publish some items of that answer.

have you tried my first answer (replace your part of HTML with mine as appropriate depending on whether it is checkbox or radio)? same results?

arthvrian left a reply on Edit() And Destroy() Functions Not Working On Shared Hosting

1, check if not true

dump(auth()->user()->id);  
dump($post->user_id);
dd(auth()->user()->id !== $post->user_id);

if(auth()->user()->id !== $post->user_id) {

or you can

if(auth()->user()->id !== $post->user_id) {
    dd('Unauthorized');
}

if you see a true from the dd() and your id's is not equals or you see Unauthorized something is happening with one of your id's

arthvrian left a reply on Send Alert When Failed Login

laravel has login events https://laravel.com/docs/5.7/authentication#events

'Illuminate\Auth\Events\Failed' => [
        'App\Listeners\LogFailedLogin',
    ],

arthvrian left a reply on How To Implement Reset Password For Custom Login

did you implement laravel auth (and customize it)? https://laravel.com/docs/5.7/authentication

or is 100% custom?

I you implemented laravel auth you have this already, if not, you must do what you wrote

  • show a view with the form to capture the user name/email
  • check if the given user exists and if do send a notification (email) with the reset link
  • if not exists redirect back and show the error message
  • the reset link will show a view with a form to change the password
  • optional you can send a email with a password changed message
17 Feb
7 months ago

arthvrian left a reply on Radio Button/checkbox Passing The Wrong Value To The Database

correct

[{
    id: 1,
    title: 'question1',
    question_type: 'radio'
    option_name: [{
        key: 'q1a1',
        value: 'answer1'
    },
    {
        key: 'q1a2',
        value: 'answer2'
    }]
},
{
    id: 2,
    title: 'question2',
    question_type: 'radio'
    option_name: [{
        key: 'q2a1',
        value: 'answer1'
    },
    {
        key: 'q2a2',
        value: 'answer2'
    }]
}]

incorrect (key is not unique)

[{
    id: 1,
    title: 'question1',
    question_type: 'radio'
    option_name: [{
        key: 1,
        value: 'answer1'
    },
    {
        key: 2,
        value: 'answer2'
    }]
},
{
    id: 2,
    title: 'question2',
    question_type: 'radio'
    option_name: [{
        key: 1,
        value: 'answer1'
    },
    {
        key: 2,
        value: 'answer2'
    }]
}]

if your result view (HTML) have errors, in browser console may see 'duplicate id xxx' (some times) or you can view page source and search for duplicates (i.e id="1")

can you post a few items of a '$question' dump()?

arthvrian left a reply on Radio Button/checkbox Passing The Wrong Value To The Database

@cronix I only answer this question :P (other questions will come :D)

I assume that $key is unique per question and HTML and question have a radio OR a checkbox (or a text or a textarea) the provided info is not enough to know if is true

Maybe he / she iterates 1-n in each option_name, in that case, the HTML provided is incorrect (not a unique ID) or maybe not

arthvrian left a reply on Radio Button/checkbox Passing The Wrong Value To The Database

like this?

<input type="radio" id="{{ $key }}" value="{{ $value }}" />

<input type="checkbox" id="{{ $key }}" value="{{ $value }}" />
```

arthvrian left a reply on Invalid Argument Supplied For Foreach(), JS File Didn't Work.

  1. the var in the foreach is empty/not exists/is not an array $question->option_name

  2. see the browser console, may be a secondary problem in your JS

arthvrian left a reply on Laravel Pagination Links Reset The GET Query

Appending To Pagination Links

You may append to the query string of pagination links using the appends method. For example, to append sort=votes to each pagination link, you should make the following call to appends:

{{ $users->appends(['sort' => 'votes'])->links() }}

in your case you can use $request->query() as parameter for appends

arthvrian left a reply on I Got An Error When Upgrading My Laravel 5.4 To 5.6

no, it should work, as long as the mysql version does not change so much

or you can go to localhost/phpmyadmin and export each database, backup htdocs, etc., uninstall current xampp and install the new version, import each database to mysql, restore htdocs, etc

16 Feb
7 months ago

arthvrian left a reply on I Got An Error When Upgrading My Laravel 5.4 To 5.6

@lestah

  1. download XAMPP zip
  2. rename your current XAMPP folder (ie c:\xampp-)
  3. unzip your download and copy to c: (c:\xampp)
  4. copy htdocs (from apache) and data (from mysql) and any other relevant folders from c:\xampp- to c:\xampp

arthvrian left a reply on I Got An Error When Upgrading My Laravel 5.4 To 5.6

You are updating to 5.7.9

EDIT: You can download updated version of XAMPP https://www.apachefriends.org/download.html

arthvrian left a reply on Prevent Shared Logins

yes, it's interactive (from the link)

Then, you may use the logoutOtherDevices method on the Auth facade. This method requires the user to provide their current password, which your application should accept through an input form

after login, you can present a form (with a password input) to invalidate the other sessions

14 Feb
7 months ago

arthvrian left a reply on Multiple Domains W/ Single Laravel Install

did you try dump instead dd?

try this (untested)

Route::domain('pro.local')->group(function () {
  Route::get('/', function () {
    dump('PRO');
  });
});

Route::domain('media.local')->group(function () {
  Route::get('/', function () {
    dump('MEDIA');
  });
});

Route::domain('software.local')->group(function () {
  Route::get('/', function () {
    dump('SOFTWARE');
  });
});

arthvrian left a reply on Https Creating An Infinite Loop In 5.2

for nginx found this https://bjornjohansen.no/redirect-to-https-with-nginx

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name _;
    return 301 https://$host$request_uri;
}

you can look at http://nginx.org/en/docs/http/configuring_https_servers.html

arthvrian left a reply on Https Creating An Infinite Loop In 5.2

try .htaccess

    # Redirect all insecure requests
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/ [L,R=301]

    # tell web browsers not to even try HTTP on this domain for the next year
    # uncomment this only after you've confirmed your site is working on HTTPS, since it commits you to providing it over HTTPS
    Header set Strict-Transport-Security "max-age=31536000" env=HTTPS

arthvrian left a reply on Why Isn't The 'deleted_at' Datetime Field Auto-casted?

I think because not all developers use soft deleted

however it will be a new feature in 5.8

13 Feb
7 months ago

arthvrian left a reply on Sending Mail Through One.com Mail Server With Laravel?

from https://help.one.com/hc/en-us/articles/115005887045-Setup-POP3-and-SMTP-for-Gmail (unrelated but may work)

Please use the following settings for the outgoing email:

SMTP server: send.one.com
Username: your email address
Password: the password you use to log in to Webmail
Port: 587
Secured connection: TLS  // (or SSL?)

arthvrian left a reply on Public And Private Visibility In Storage

if you use the local disk, i think that visibility is not working/used (everything goes to local public folder), if you use s3 or other this will work

arthvrian left a reply on Sending Mail Through One.com Mail Server With Laravel?

you miss this

Port and encryption:
- 587 with STARTTLS (recommended)
- 465 with TLS
- 25 with STARTTLS or none

you must set MAIL_ENCRYPTION (if you use the 587 port) to ssl (or tls if still not working) or use port 25 with MAIL_ENCRYPTION=null

arthvrian left a reply on Getting The Login To Redirect To The Previous Page

yes (redirects to home),

but you can use back()

Sometimes you may wish to redirect the user to their previous location, such as when a submitted form is invalid. You may do so by using the global back helper function. Since this feature utilizes the session, make sure the route calling the back function is using the web middleware group or has all of the session middleware applied:

Route::post('user/profile', function () {
    // Validate the request...

    return back()->withInput();
});

arthvrian left a reply on Laravel Passport API With Javascript

is the route login listed (after running this command)?

php artisan route:list

12 Feb
7 months ago

arthvrian left a reply on How To Get Id In Hidden Field From Slug In Laravel?

get the id (school_id) in the controller and pass to the view

// example

public function index($school_id) {
    return view('reviews', compact('school_id')):
}

in the view:

<input type="hidden" name="id" value="{{ $school_id }}}">

arthvrian left a reply on Too Few Arguments To Function App?Http?Controllers?PostController::DateiAusGnu(), 0 Passed And Exactly 1 Expected

is $post defined in the controller? is $post not null? is $post passed to the view?

11 Feb
7 months ago

arthvrian left a reply on Capturing Checkboxes With An Array.

replace

<input class="mr-2" type="checkbox" name="answer[]" checked>Yes

With

<input class="mr-2" type="checkbox" name="answer[]" checked value="1">Yes

i think you must add a javascript event (un-check) to set value="0"

or you can run a loop over the answers in your store method and check if the answer array have these id (value="on")

arthvrian left a reply on Laravel 42000 Syntax Error Or Access Voilation 1064 You Have An Error In Sql Syntax

as it says, it's an sql error 'data-> type' is the name of the column in your table? or just 'type'? (I guess its 'type')

10 Dec
9 months ago

arthvrian left a reply on PHP Query

short answer: in PHP you MUST define a variable BEFORE use it

long answer: before run a SQL query, you MUST validate, sanitise and secure your input (local or user input), another link to read :P https://www.dreamhost.com/blog/php-security-user-validation-sanitization/

18 Nov
10 months ago

arthvrian left a reply on Changing The Heading In Forgot Password

  1. php artisan vendor:publish and select laravel-mail tag (I'm not sure)
  2. Edit resources/views/vendor/mail/html/header.blade.php

Note: All mails share the same structure

17 Nov
10 months ago

arthvrian left a reply on How To Hit The Api Route

try php artisan route:list, check for api routes

EDIT 'normal' api routes not need authenticate (unless you put auth:api)

did you run php artisan make:auth? the browser keeps on 'localhost/api/user'? or redirects to localhost/login?

12 Nov
10 months ago

arthvrian left a reply on Laravel Where('user_id') Seems Completely Ignored

OR WHERE invalidate the previous WHERE, query result:

SELECT * FROM Pigeon WHERE user_id =? AND name LIKE '%?%' OR ringnumber LIKE '%?%'

You can do someting like:

User::pigeons()->where('name', 'LIKE', '%'.$q.'%')->orWhere('ringnumber','LIKE','%'.$q.'%')

arthvrian left a reply on Why Did Not Save Multiple Images With Controller Route Return?

nope, the return must be outside the loop:

for (....) {
    ....
    $upload->save();
}
            
return redirect()->route('categories.categorypost')->with('info','Your Advertisment has been created successfully');
        

arthvrian left a reply on Why Did Not Save Multiple Images With Controller Route Return?

You must close the for BEFORE the return (i don't see the } AFTER the $upload->save())

10 Nov
10 months ago

arthvrian left a reply on Google Gmail SMTP

Is the domain hjorturfreyr.com using GSuite?

Yo cann't send a email throught gmail without a google accout (Gmail/GSuite)

[email protected] // must be a Google Account