syntax error, unexpected ‘if’ (T_IF) en laravel

Estoy en el controlador del login para un administrador y me da un error un If, lo he revisado varias veces en base al tutorial que estoy siguiendo, pero no logro encontrar el error.

<?php  namespace App\Http\Controllers\Auth;  use Illuminate\Http\Request; use App\Http\Controllers\Controller;  class AdminLoginController extends Controller {      public function __construct(){         $  this->meddleware('guest:admin');     }      public function showLoginForm(){         return view('auth.admin-login');     }      public function login(Request $  request){         //Validate the form         $  this->validate($  request, [             'email' => 'requiered|email',             'password' => 'requiered|min:6',         ])          //Attempt to log the user in         if (Auth::guard('admin')->attempt(['email' => $  request->email, 'password' => $  request->password], $  request->remember))  {             //if successful, then redirect to their intendd location             return redirect()->intended(route('admin.dashboard'));         }          //if unsuccesssful, then redirect back to te login with the form data.         return redirect()->back()->withInput($  request->only('email', 'remember'));     } } 

Me indica que es la linea 27, que es el if, pero no logro encontrar el error.

Syntax agreement between programming languages [on hold]

Can we all come to a common syntax agreement for our everyday semantics ?

For e.g.

Lambda expressions some use -> while some use =>
For String interpolation some use {{}} while some use $ {}
For multi line string some use ”’string”’ others use string
For dependency Injection some use @Inject while some @Injectable, @Autowire while a few others have no visible indicator

I’m not talking about semicolons, braces etc. But, For the syntaxes that are taking shape and will take shape can the spec developers of the language sit together and come to an agreement ? It would make life so much simpler for a programmer jumping between multiple languages.

Talking in general sense,
I understand humanity couldn’t fully agree upon using metric system but again most of the humanity moved to it, we might not have agreed upon whether to place a comma or a dot in our currency, we might be still debating on the daylight saving time change however, in all these cases we can atleast group them so we know what to use for things in a common group, making life easy and good that some are being debated for the thing forward.

For something like tab vs spaces, which we couldn’t forever agree, we atleast have tools now to auto convert basing on our configs.

Would like hear your thought. I really hope life of programmers who have to juggle between multiple programming languages are kept in mind when designing new specs as we move forward and things are made easy. Thank you.

My objective of this question is to atleast ignite a thought for some debate and I felt no platform better than stackexchang would suite for it. Please.

Magento 2.2.9 Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) magento setup:upgade command

I received the error when I try to run

php bin/magento setup:upgrade

after i did

composer require magento/product-community-edition 2.2.9 –no-update

composer update

for updating from magento 2.2.6. to 2.2.9 (which went fine)

error message is ......... Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE)...../interceptor.php 

magento version is 2.2.7 – > 2.2.9

php version is 70.033

I have searched and found a few answers, but all applied to 2.3.x version, which required high php versions (7.1 or 7.2). so i also tried the following command

php72 bin/magento setup:upgrade

which came out with another error..

Class or object-based syntax highlighting in an IDE

I’m wondering if there is a way to set up a code editor color formatting so that instead of just coloring based on standard “syntax”, the color coding is based on relationships between the objects.

For example, in this JavaScript (P5) sketch, https://editor.p5js.org/knectar/sketches/xdlMtbmbv I’m calling the method showGrid which is part of the DotGrid class. So, my brain would like to see showGrid in a color that is unique to and linked with class. This would allow me to associate what goes with what in the code more intuitively.

Is this a thing? I’m using Atom, but I’m not quite sure even what to search on.

I have python syntax error in django project

first, i am beginner of django and python i want to make sign up and login service but i have python syntax error

I use python 3.7.3

from django.shortcuts import render from django.contrib.auth.models import User from django.contrib import auth  def signup(request):     if request.method == "POST" :         if request.POST["password1"] == request.POST["password2"] :             user = User.objects.create_user{                 username=request.POST["username"], password = request.POST["password"]                 if user is not None:                     auth.login(request,user)                     return redirect['home']                 else:                     return render(request, 'login.html', {'error': 'username or password is incorrect'})         else:             return render(request,'login.html')             }

in line 8, (user = User.objects.create_user) i have syntax error help me!

PowerShell Function syntax question

I’m trying to get up to speed on PowerShell and have some difficulty understanding how to specify that a function requires parameters. The example that I’m looking at has to different functions, and the syntax for their parameters are specified differently. Can a function declare parameters in two different ways? And in this first function what is the Process command??? The syntax of the second function makes much more sense to me.

function Get-SPOnlineFileDetails() {     Param(         [Parameter(Mandatory=$  true,ValueFromPipeline, HelpMessage="SharePoint Online source site URL")]         [String]         $  sourceUrl,         [bool]         $  Recurse,         [bool]         $  IncludeFileSize           )     Process{          Write-Host "###################### Pull Details From SharePoint Online ######################" -ForegroundColor Green          Write-Host "Provided Source URL :"$  sourceUrl -ForegroundColor Green          try{ ... 

Second function……

function PopulateData($  web, $  incldeFileSize){         Write-Host "Current Site " $  web.url -ForegroundColor Cyan                    $  libs = Get-PnPList -Web $  web | Where{($  _.BaseType -eq “DocumentLibrary”) -or ($  _.Title -eq "Pages") }                    foreach($  lib in $  libs){ ... 

What are the best documentation sources for SQL query commands and syntax?

I have been looking and looking for a good source for SQL query language documentation online. I haven’t been able to find any good source.

Cross-cutting this question is the fact that I think there are different flavors of SQL.

So perhaps the question should be re-phrased: What are the best sources for the various flavors of SQL? (e.g. MySQL, PostgresSQL, etc…)

And also: Given that there are many flavors of SQL, is there a core SQL syntax that is common to all?

One source that I’ve found that I don’t find particularly good is the from w3schools.

Correct syntax for conditional statement in pandas

I have a conditional statement I’m trying to workout in pandas in Anaconda. I’ve installed numpy as np.

I need to create a new “Text” field and, if the existing “truncated” field is “False”, use the string in the existing “text” field. Otherwise, (or if the value of the “truncated” field is “True”, use the string in the existing “extended_tweet.full_text” field.

Trying to follow instructions on this page, but it’s not a direct parallel, as my ‘choices’ are the values of other fields, and not a given string. Pandas conditional creation of a series/dataframe column

Here’s my code:

conditions = [     (df['truncated'] == 'False'),     (df['truncated'] == 'True')] choices = ['text'], ['extended_tweet.full_text'] df['Text'] = np.select(conditions, choices, default='null') 

After running that, all ‘Text’ values are ‘null’

I’ve tried variations for the ‘choices’ options code, and am thinking the problem is the way I’m indicating the options in the choices line (the example code I’m following is using given ‘string’ values). But I can’t sort out the right way to indicate I want the string values in the stated fields used in the new ‘Text’ field.

Any help greatly appreciated.

When splitting data to a hash data structure, what is the syntax for multiple assignment?

I am going through the “Head First” Learn to Program text for python 2.7, and as I was working through one of the exercises. It gave me a clue to multiple assign a line of data, while splitting it. And since I could not guess it, I went to the solution, and I do not understand the solution.

I am running the latest python in the native IDLE

”’python

line = “101;Johnny ‘wave-boy’ Jones;USA;8.32;Fish;21”

display = {}

(display[‘ID’], display[‘Name’], display[‘Country’], display[‘Average’], display[‘Board’], display[‘Age’]) = line.split(‘;’)

”’

I do not understand what is going on with the multiple assignment in the code above. How is the splitting making key and value pairs?

What role are the braces playing in this?

When I guessed for multiple assignment I imagined this:

(ID, Name, Country, Average, Board, Age) = line.split(;)

for a, b, c, d, e, f in line: display[ID] = Name, Country, Average, Board, Age

I thought that I could assign several values to one key, and just index or iterate the has with the keys() or items() method