Questions tagged as 'laravel'

1
answer

Laravel Authentication 5.4

Talk to people, so recently I started to study Laravel through some books / video lessons, and I'm bending my head with something about authentication. When I run the command php artisan make:auth Laravel returns me The Routes Aut...
asked by 08.04.2017 / 17:49
1
answer

How to configure an Anonymous Global Scopes in Laravel?

Within my model I'm using an Anonymous Global Scopes to skip some operations: protected static function boot() { parent::boot(); static::addGlobalScope('owner', function (Builder $builder) { $builder->where('user_id', 1);...
asked by 06.02.2018 / 19:09
1
answer

Project copy without Laravel Framework installation

Is it possible to copy a Laravel project to a server without having to install Laravel on that server? Is it just to copy the files or do I have to do some additional configuration, besides pointing the DNS to the public folder?     
asked by 09.02.2017 / 14:28
2
answers

How to relate two records elegantly?

At some point in my application I'm creating a post and relating it to the session user: public function adicionar(CadEditPost $request) { $request->merge(['user_id' => Auth::user()->id]); if(Post::create($request->...
asked by 17.12.2016 / 20:14
1
answer

Wide Angle API

I am trying to make a request using angular connecting to REST API built in laravel. XMLHttpRequest cannot load http://localhost:8000/rest/v1/entidades/licitacoes. No 'Access-Control-Allow-Origin' header is present on the requested resource....
asked by 21.06.2016 / 20:31
2
answers

Database overload when deleting rows with relationships?

Good afternoon everyone! I have a question, and I would like to hear your comments. I'm building a system in php + laravel . I have relationships between tables, for example: Users->Roles .    It is assumed that there are...
asked by 18.05.2016 / 22:10
1
answer

Catch specific columns with Laravel querybuilder

Consider that my table in the DB has many columns. But for a specific query I do not need all of them.  How would I do it in Laravel (using both Eloquent and QueryBuilder to get just the columns I need?     
asked by 28.03.2016 / 14:51
1
answer

Laravel find () function giving error

When I launch a search with an id that exists in the database, it works normally.    Laravel 5.6 public function findProduto($id) { $produto = Produto::find($id)->with('imagemgame')->first(); return $dados_check = $produt...
asked by 25.08.2018 / 03:17
1
answer

Error Accessing Site on Earth Hosting

I transferred a web site to a Terra hosting and trying to access it shows the following error:    Not Found [CFN # 0005] I'm talking to the support - horrible, by the way (Neto) - and they say it's my programming that's wrong. Ask to c...
asked by 03.11.2015 / 16:35
1
answer

Why use unless in Laravel, instead of a negation in if?

I find Laravel an interesting framework. The functionality of the view is excellent, for simplifying the syntax of a foreach or if for example. But one thing I did not understand is: Why does unless ? Why use...
asked by 26.04.2016 / 22:41