laravel-4

How to send data using redirect with Laravel

我只是一个虾纸丫 提交于 2019-12-30 02:37:10
问题 I developed an API to show a pop up message when the page loaded. Not all the pages use the pop up API. For example, if the user go to the show($id) page, that doesn't required the pop up api to fire. but in some special cases, I need the pop up to be fired. Here is my code, ** this code is just to illustrate my point, not an actual working code** public function store(){ validating the input saving them $id = get the id return Redirect::route('clients.show, $id') } and in the show function I

Laravel4 POST unexplained redirect to GET

假如想象 提交于 2019-12-29 08:54:09
问题 Another I-did-not-sleep-enough question, I'm sure. I'm posting it as a sacrifice to the Elder God Murphy: as soon as I expose my moronity for all to see, I'm guaranteed to find by myself that answer that otherwise will elude me for hours ( by way of further penance, I will then post the answer as well ). I have a HTML form that gets rendered as <form method="post" id="mysearch" action="/search/?uid=1701"> <input id="searchterm" type="text" name="query" /> </form> The form can be submitted via

Laravel and Infinite Scroll

▼魔方 西西 提交于 2019-12-29 03:39:51
问题 I have a question about laravel pagination and infinite scroll : First of all, I have this : <div class="row"> <div id="boxes"> @forelse($duels->results as $d) <div class="col-span-4 box notizy"> @include('versus.versus') </div> @empty @endforelse </div> <div class="col-span-12"> <div class="paginate text-center"> {{$duels->links()}} </div> </div> As we can see, I have a div #boxes which contain divs .box . The pagination is set by Laravel and looks like this : <div class="col-span-12"> <div

laravel blade @include not working

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-29 01:41:27
问题 I am trying to include files in my homepage using blade syntax :- @foreach($data as $articles) @include(app_path().$articles->path) <br /> @endforeach This is not working. The error says :- View [/var/www/blogproject/project/app/pages/articles/first-post.php] not found I even tried including just the first page :- @include(app_path().'/pages/articles/first-post.php') But the normal php include is working fine :- <?php include(app_path().'/pages/articles/first-post.php'); ?> Please help 回答1:

Laravel 4 simple route not working using mod_rewrite, and .htaccess

耗尽温柔 提交于 2019-12-28 11:58:22
问题 I'm not only new to Laravel 4, but new to using frameworks. I thought I'd start with Laravel since it's gotten such good reviews. I've got a good install of Laravel. I go to /l4/public and see the welcome page. I'm trying to add a route to routes.php so that when I navigate to /l4/public/articles I get a response. I get "The requested URL /l4/public/articles was not found on this server." Do I need to run an artisan command to compile the routes? It's probably something easy. Why this message

Laravel 4 simple route not working using mod_rewrite, and .htaccess

我只是一个虾纸丫 提交于 2019-12-28 11:54:26
问题 I'm not only new to Laravel 4, but new to using frameworks. I thought I'd start with Laravel since it's gotten such good reviews. I've got a good install of Laravel. I go to /l4/public and see the welcome page. I'm trying to add a route to routes.php so that when I navigate to /l4/public/articles I get a response. I get "The requested URL /l4/public/articles was not found on this server." Do I need to run an artisan command to compile the routes? It's probably something easy. Why this message

Laravel 4 simple route not working using mod_rewrite, and .htaccess

瘦欲@ 提交于 2019-12-28 11:54:02
问题 I'm not only new to Laravel 4, but new to using frameworks. I thought I'd start with Laravel since it's gotten such good reviews. I've got a good install of Laravel. I go to /l4/public and see the welcome page. I'm trying to add a route to routes.php so that when I navigate to /l4/public/articles I get a response. I get "The requested URL /l4/public/articles was not found on this server." Do I need to run an artisan command to compile the routes? It's probably something easy. Why this message

Laravel Soft Delete posts

会有一股神秘感。 提交于 2019-12-28 11:45:10
问题 in our project we must be use soft delete for each posts. in laravel document i think we can only use this feature for tables. can we use that for posts on table such as $id = Contents::find($id); $id->softDeletes(); 回答1: When soft deleting a model, it is not actually removed from your database. Instead, a deleted_at timestamp is set on the record. To enable soft deletes for a model, specify the softDelete property on the model (Documentation) : Prior to Version 4.2 (But not 4.2 & Later) For

How to save/redirect output from Laravel Artisan command?

[亡魂溺海] 提交于 2019-12-28 05:54:07
问题 I'm using Artisan::call() in one of my routes and would like to save the command output to a variable. Is there any way to capture the STDOUT and STDERR generated by the artisan command? 回答1: This is a way: use Symfony\Component\Console\Output\BufferedOutput; Route::get('/test', function() { $output = new BufferedOutput; Artisan::call('list', array(), $output); return $output->fetch(); }); 回答2: Seems the previous answers don't work in Laravel 5.2 any more (not sure about 5.1) You can now use

Laravel 4.2 says my application is in production. How do I turn this off?

徘徊边缘 提交于 2019-12-28 05:49:48
问题 I have a fresh install of Laravel. When running php artisan migrate:refresh I get a message saying Application In Production! Do you really wish to run this command?' I know this is an update in 4.2, however I can't figure out how to turn it off. I found in the source that it comes from Illuminate\Console\ConfirmableTrait and runs if this if test passes : if ($this->getLaravel()->environment() == 'production') I'm not sure why it thinks I'm in production. I never setup any environments. This