Questions tagged as 'laravel-4'

2
answers

Problem with Seed Relationship between Category and Sub-Category in Laravel 4

I do not know how I do with my Seeds, I have 2 entities: Category and Subcategory. I want to be able to run seeds and be able to register my Categories and after my Subcategories, only Subcategory has a relationship with Category: needs id...
asked by 16.03.2014 / 18:01
1
answer

Is there any way to generate migrations based on an existing Laravel database?

When I used Python's Django, I was surprised by the inspectdb command, which is able to generate the models based on an existing database. In Laravel, we have the migrations to be able to work with the database, and I find a clean and...
asked by 06.09.2018 / 15:03
3
answers

How to find the base url of Laravel?

I remember that when I used the Codeigniter framework, I could figure out which was the base url of the application, simply calling base_url() . In Laravelle 3, I used URL::base() . But now, in Laravel 5, when I call URL::base(...
asked by 24.08.2016 / 15:40
1
answer

Laravel 4.2 - 405 Method Not Allowed

I have a route that was working normally and stopped working for no apparent reason. It has the following configuration: Route::put('/clientes', 'Clientes@update'); The error I get is: Method Not Allowed The requested method PUT is not al...
asked by 04.11.2015 / 10:20
1
answer

Is there any way to run Laravel on the command line in interactive mode?

In PHP, I know you can run it interactively on the command line, which is through the command php -a . Better still be using the library psysh . But when it comes to not just running simple tests, but running an application inte...
asked by 01.03.2016 / 13:26
1
answer

How do I define routes in Laravel that work only in the development environment?

I would like to know how I can define routes in Laravel that work only in the development environment. I think this can be useful to make it easier to debugs . I want to be able to separate some routes to use only when in development...
asked by 02.09.2015 / 17:27
1
answer

View PDF after AJAX call with TCPDF in Laravel 4

After I save information to the database using the following code. $this->anamnese->create($input); I just call to test a code to generate a test PDF with the following code. PDF::SetTitle('Hello World'); PDF::AddPage(); PDF::Write(...
asked by 16.10.2014 / 23:30
2
answers

Implementation AngularJS consuming data provided by Laravel using CORS

I'm trying to create a web service in Laravel 4, which will be consumed by a mobile application using AngularJS. When I make AJAX requests with AngularJS, it gives Cross Domain error because it is in another domain. How to solve?     
asked by 16.12.2013 / 12:07
1
answer

Creating Foreign Keys by Migration - Laravel

I'm having trouble when I try to create foreign keys for Migration in Laravel. Look at my Migration !!! <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateEmpresaUsuarioTable exten...
asked by 22.06.2014 / 02:37
1
answer

trashed () returning 'true' after restore ()?

I have a Manifestation template that uses SoftDeletingTrait to keep them inactive in the database and in ManifestationController I have the following destroy() method: $manifestation = Manifestation::findOrFail($id)...
asked by 16.01.2017 / 19:28