We want to go from this:
... to that:
git fetch --all | |
git reset --hard origin/master | |
git pull origin master |
<?php | |
namespace Acme\Bundle\ContractBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
class ContractController extends Controller | |
{ | |
public function eventAction(Contract $contract) | |
{ | |
$event = new ContractEvent($contract); |
from smlr
First, create your AAdmin, ABAdmin and BAdmin Classes like you would, if those Classes wouldn't share any relation. After this, add to your sonata.admin.A service a Child sonata.admin.AB (Admin.yml or Admin.xml).
Than you can use the configureSideMenu() method in AAdmin to create a sidemenu and generate a link to ABAdmin.
It's important to add $parentAssociationMapping to your ABAdmin Class and adding some if-statements to improve the usability, if list and form is in a A-context.
If you know the mechanism, it's quite easy. Hope my example works for you..
/*! X-editable - v1.5.1 | |
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery | |
* http://github.com/vitalets/x-editable | |
* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */ | |
/** | |
Form with single input element, two buttons and two states: normal/loading. | |
Applied as jQuery method to DIV tag (not to form tag!). This is because form can be in loading state when spinner shown. | |
Editableform is linked with one of input types, e.g. 'text', 'select' etc. | |
@class editableform |
Laravel - Eloquent - query many to many relationship
Example:
Table 1: posts
Table 2: categories
Pivot Table: category_post with foreign keys category_id, post_id
@if ($paginator->hasPages()) | |
<div class="flex items-center"> | |
{{-- Previous Page Link --}} | |
@if ($paginator->onFirstPage()) | |
<span class="rounded-l rounded-sm border border-brand-light px-3 py-2 cursor-not-allowed no-underline">«</span> | |
@else | |
<a | |
class="rounded-l rounded-sm border-t border-b border-l border-brand-light px-3 py-2 text-brand-dark hover:bg-brand-light no-underline" | |
href="{{ $paginator->previousPageUrl() }}" | |
rel="prev" |
#!/bin/sh | |
# This script creates a supervisor program for the Laravel queue worker and writes | |
# the log to the storage folder of the project. It also starts the http server on | |
# port 9001 so you need to add this port forwarding to your Homestead.yaml file. | |
sudo sh -c 'echo "[inet_http_server] | |
port = 9001 | |
username = homestead | |
password = secret |
{% capture option_titles %}Color,color,Colour,colour{% endcapture %} | |
{% assign option_titles = option_titles | split:',' %} | |
{% for option in product.options %} | |
{% if option_titles contains option %} | |
{% capture option_index %}option{{ forloop.index }}{% endcapture %} | |
{% assign option_values = product.variants | map: option_index | uniq %} | |
{% if option_values.size != 1 %} | |
{% for opt in option_values %} |
# Change to the project directory | |
cd $FORGE_SITE_PATH | |
# Turn on maintenance mode | |
php artisan down || true | |
# Pull the latest changes from the git repository | |
# git reset --hard | |
# git clean -df | |
git pull origin $FORGE_SITE_BRANCH |